EXCEPT operator will be used to determine which rows exist only in the left table of the query,TableA, and not in TableB:
SELECT EmployeeID,Name FROM TableA
EXCEPT
SELECT EmployeeID,Name FROM TableB
This Returns:
Emploteeid Name
-------------------- ------------------------------
1 Nancy
2 Andy
3 Janet
4 Margaret
5 Steven
This query have very less execution plan compare to not in operator.
Friday, September 25, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment