You see things; and you say 'Why?' But I dream things that never were; and I say 'Why not?'

Monday, February 9, 2009

Unmatching records between two tables

SELECT SID FROM TABLEA T1 WHERE NOT EXISTS (
SELECT * FROM TABLEB T2
WHERE (T1.SID=T2.SID))

(or)

(select TABLEA.SID from TABLEA) EXCEPT
(select TABLEB.SID from TABLEB)

No comments:

Followers