Wednesday, April 3, 2013

sql server 2005 - sql query to return differences between two tables - Stack Overflow

Stack Overflow logo
Stack Overflow logo (Photo credit: Wikipedia)
Here is a good little article about how to write an SQL query to find the differences between two tables

SELECT A.*, B.*
FROM A
    FULL JOIN B ON (A.C = B.C)
WHERE A.C IS NULL OR B.C IS NULL
 
Where A and B are table names; C is the common field 

sql server 2005 - sql query to return differences between two tables - Stack Overflow
Enhanced by Zemanta

No comments: