首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

SQL 查询出不存在B表中的A表的数据解决思路

2013-07-20 
SQL 查询出不存在B表中的A表的数据select a1 from A where a1 not in (select a1 from B)但是我的where条

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)

热点排行