作者:广东在线游戏网日期:
返回目录:游戏资讯
可以是可以,就你提供的数据来看用not exists反而麻烦,用not exists需要提供另外一个表的
按你的要求用not exists
select id from table where not exists(select 1 from (
select 1 id union
select 2 union
select 3
) tmp where tmp.id=table.id
)
是吧 ,够麻烦吧~
not in 和not exists一般(也有例外,比如子表中有NULL,就会出现不同的结果)会e68a847a686964616f335达到相同的结果
你还没理解exist的真谛知
Select a.学生姓名,a.学号道,a.年级 from Table1 as a
where not exists (select 1 from table1 as b where a.学号=b.学号 and a.是否是贫回困生='是')
其中a.学号=b.学号 这个答才是关键