SELECT * FROM TABLE_A WHERE columnA NOT IN (SELECT columnA FROM TABLE_B) and columnB NOT IN (SELECT columnB FROM TABLE_B)
SELECT * FROM TABLE_A WHERE columnA NOT IN (SELECT columnA FROM TABLE_B)
SELECT * FROM TABLE_A AS A WHERE NOT EXISTS( (SELECT * FROM TABLE_B WHERE columnA=A.columnA AND columnB=A.columnB)
SELECT * FROM TABLE_A WHERE (columnA,columnB) NOT IN (SELECT columnA,columnB FROM TABLE_B) 这个在sqlserver 中怎么写 这样写说不行。 select * from table_A a where not exists (select 1 from table_b b where b.columnA=A.columnA and b.columnb=a.columnb)
SELECT * FROM TABLE_A WHERE columnA NOT IN (SELECT columnA FROM TABLE_B) and columnB not in (select columnB from TABLE_B)
and columnB NOT IN (SELECT columnB FROM TABLE_B)
(SELECT * FROM TABLE_B
WHERE columnA=A.columnA AND columnB=A.columnB)
select * from table_A a where not exists
(select 1 from table_b b where b.columnA=A.columnA and b.columnb=a.columnb)
SELECT * FROM TABLE_A WHERE columnA NOT IN (SELECT columnA FROM TABLE_B) and columnB not in (select columnB from TABLE_B)