SQL 查询出不存在B表中的A表的数据
select a1 from A where a1 not in (select a1 from B)
但是我的where条件不是一个列 而是两个列怎么弄?
select a1,b1 from A where a1,b1 not in (select a1,b1 from B)
这样又不行? 请问怎么实现。
------解决方案--------------------试试
select a1 from A where not exists (select a1,a2 from B)