sql中exists,not exists的用法
exists : 强调的是是否返回结果集,不要求知道返回什么, 比如:
select name from student where sex = 'm' and mark exists(select 1 from grade where ...) ,只要
exists引导的子句有结果集返回,那么exists这个条件就算成立了,大家注意返回的字段始终为1,如果改成“select 2 from
转载
2016-10-08 21:00:23 ·
4945 阅读 ·
0 评论