select * from A a where not exists(select 1 from a where a.ITEM =b.CODE);
select a.* from a where item not in (select code from b) select a.* from a where not exists (select 1 from b code = a.item)select b.* from b where code not in (select item from a) select b.* from b where not exists (select 1 from a item = b.code)
select a.* from a where not exists (select 1 from b b.code= a.item) select b.* from b where not exists (select 1 from a a.item = b.code);select a.* from a where not exists (select 1 from b b.code= a.item) union all select b.* from b where not exists (select 1 from a a.item = b.code);
select a.* from a where not exists (select 1 from b b.code= a.item) union all select b.* from b where not exists (select 1 from a a.item = b.code); 这个固然可以,但是可能会影响性能,找找oracle中类似连接用法,会提高性能很多。
select a.* from a where item not in (select code from b)
select a.* from a where not exists (select 1 from b code = a.item)select b.* from b where code not in (select item from a)
select b.* from b where not exists (select 1 from a item = b.code)
select a.* from a where not exists (select 1 from b b.code= a.item)
select b.* from b where not exists (select 1 from a a.item = b.code);select a.* from a where not exists (select 1 from b b.code= a.item)
union all
select b.* from b where not exists (select 1 from a a.item = b.code);
union all
select b.* from b where not exists (select 1 from a a.item = b.code); 这个固然可以,但是可能会影响性能,找找oracle中类似连接用法,会提高性能很多。