oracle中查二张表的差集(使用minus),结果如何不去重?

minus有自动剃重的功能,但我想要所有的数据,如何不去重?求大神!!!

第1个回答  2018-06-27

用 not exists 或者 left join

select * from A where not exists (select 1 from B where A.F1=B.F1 ……)
select A.* from A left join B on A.F1=B.F1 …… WHERE B.F1 is null

本回答被提问者和网友采纳