sql 查询表A和表B.查A表中的c字段和B表中d字段不相同的记录。。A表的e字段和B表的f字段是关联的。

sql 查询表A和表B.查A表中的c字段和B表中d字段不相同的记录。。A表的e字段和B表的f字段是关联的。

select * from A where not exists (select 1 from B where A.c=B.d)----显示A表记录
select * from B where not exists (select 1 from A where A.c=B.d)----显示B表记录
温馨提示:答案为网友推荐,仅供参考
第1个回答  2013-02-24
select * from A where c not in (select d from B)
相似回答