select * from a where exists(select id from b wherea.id=b.id); 和 select * from a where exists(select id from b); 难道上面两句不是一回事么?请指教:)
select * from a where exists(select id from b where a.id=b.id); --B表有id=a.id的数据才返回TRUE 和 select * from a where exists(select id from b); --只要B表有数据就返回TRUE
not exists和not in的区别呢?也像上面那样呢?
和
select * from a where exists(select id from b);
难道上面两句不是一回事么?请指教:)
--B表有id=a.id的数据才返回TRUE
和
select * from a where exists(select id from b);
--只要B表有数据就返回TRUE
你看看NULL方面的