MySQL中exists和not exists的用法介绍

exists : 强调的是是否返回结果集,不要求知道返回什么, 好比:html select name from student where sex = 'm' and mark exists(select 1 from grade where ...) 只要exists引导的子句有结果集返回,那么exists这个条件就算成立了,你们注意返回的字段始终为1,若是改为“select 2 from g
相关文章
相关标签/搜索