When comparing data (fields) between two tables is there an advantage to using EXCEPT, INTERSECT, or, in the case of looking for data in ONE field between two tables, can a JOIN of the two tables accomplish the same thing?
ex: //join two tables and look for matching fields: select t.FIELD, t2.FIELD from tableone t join tabletwo t where t.FIELD = t2.FIELD
ex2: //two tables comparing the same two fields using intersect:
ex3: //two tables comparing the same two fields using except:
Appreciate any help provided.
asked 18 Apr '11, 09:43
A join, by definition, will produce a result set with matches. EXCEPT will produce a result set containing differences.
INTERSECT is roughly equivalent to inner join except that:
answered 18 Apr '11, 11:29