1.exists(in) : 强调的是是否返回结果集,不要求知道返回什么,只要exists引导的子句有结果集返回,那么exists这个条件就算成立了
not exists(in)跟exists正相反,没有结果条件成立(not in 不能使用索引)
select name from student where sex = ‘m’ and exists (select 1,2,3 from grade where …)
1.exists(in) : 强调的是是否返回结果集,不要求知道返回什么,只要exists引导的子句有结果集返回,那么exists这个条件就算成立了
not exists(in)跟exists正相反,没有结果条件成立(not in 不能使用索引)
select name from student where sex = ‘m’ and exists (select 1,2,3 from grade where …)