当前位置:首页>开发>正文

在mysql中实现嵌套查询 mysql 嵌套查询

2023-04-28 23:52:44 互联网 未知 开发

 在mysql中实现嵌套查询 mysql 嵌套查询

在mysql中实现嵌套查询

select yr_student_info.name from yr_student_info where yr_student_info.school_id in (select yr_school_info.id from yr_school_info where yr_school_info.province=上海 and yr_school_info.city=上海)

mysql 嵌套查询

你的sql语句中 的 from 和 to 与sql保留关键词 有冲突。

select
a.train_no, a.sequ_no t_from , b.sequ_no t_to
from
(select * from aa where st_name= "xxx" ) as a ,
(select * from aa where st_name= "xx") as b
where
a.train_no = b.train_no and a.sequ_no或者 select a.train_no, a.sequ_no as `from` , b.sequ_no as `to` from (select * from aa where st_name= "xxx" ) a inner join (select * from aa where st_name= "xx") b on a.train_no =b.train_no where a.sequ_no

mysql 如何对一张表进行嵌套查询

你这是更新,不是查询

update a
set a.MULTISELECT_ID=b.MULTISELECT_ID
from RES_OBJECT a,RES_OBJECT b
where (a.MULTISELECT_ID is null or
a.MULTISELECT_ID=0)
and b.RES_ID=PARENT_NODE_RES_ID

最新文章