|
Posted by Erland Sommarskog on 09/03/06 14:42
Your name (fake.email@address.com) writes:
> I'm trying to figure out a way to compare two tables, table one has more
> entries than table two, I want SQL to compare table one to table two and
> spit out and XLS of the enries that exist in table one, but not in table
> two.
SELECT a.*
FROM a
WHERE NOT EXISTS (SELECT *
FROM b
WHERE a.keycol = b.keycol)
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
Navigation:
[Reply to this message]
|