当前位置:Gxlcms > 数据库问题 > SQL in/not in/exists/not exists

SQL in/not in/exists/not exists

时间:2021-07-01 10:21:17 帮助过:3人阅读

name from student where name in(zhang,wang,zhao);
select * from A where cc in(select cc from B) 

(2)in 与 “=”的区别:

select name from student where name in(zhang,wang,zhao);
select name from student where name=‘zhang‘ or name=‘wang‘ or name=‘zhao‘

*IN 和 NOT IN并不是针对索引的,因此查询会消耗大量时间

二、EXISTX / NOT EXISTS 

SQL in/not in/exists/not exists

标签:sql   区别   round   from   sele   back   col   div   name   

人气教程排行