SQL经典有关问题,大家帮忙回答一下
SQL经典问题,大家帮忙回答一下.
<>all等价于 not in
<>some不等价于not in
怎么说明这一点?
------解决方案--------------------
<>all等价于 not in
<>some不等价于not in
怎么说明这一点?
------解决方案--------------------
- SQL code
--<>all等价于 not in --<>some不等价于not in declare @a table (id int) insert into @a select 1 insert into @a select 2 insert into @a select 3 insert into @a select 4 declare @b table (id int) insert into @b select 4 insert into @b select 5 insert into @b select 6 insert into @b select 7 select * from @a where id<>all(select id from @b) select * from @a where id<>some(select id from @b where id=4) select * from @a where id<>some(select id from @b)
------解决方案--------------------
<>all ==》 not in (all)
<>some ==》 in (some)
------解决方案--------------------
这个的理解,逻辑思维稍微好那么一点点的人都应该能了解,估计楼主是静不下心来理解
------解决方案--------------------
用实例去实际操作一些,就可看到区别了,如同一楼。
------解决方案--------------------
SQL..我什么时候才能学完啊..继续学习.刻苦学习.