SQL 子查询select

--子查询
--独立子查询
select * from student 
where sclass in
(select cid form class where cName='高一一班' or cName='高二一班') 
--关联子查询  exists() 函数表示 ,当exists括号中的条件为true时,执行
select * from student 
where exists
(select cid form class 
	where (cName='高一一班' or cName='高二一班') and clase.cid =student.sclassid)
发布了55 篇原创文章 · 获赞 4 · 访问量 1424

猜你喜欢

转载自blog.csdn.net/BowenXu11/article/details/104730694