Monday, January 7, 2013

SQL Exclusion Join

So, what if you want to see if records in one table exist in another one?   For example, two mail lists.. with tables that may not even have similar layouts, but have similar-ish fields, like first, last, email.... LEFT OUTER JOIN to the rescue.

Special thanks to: http://www.xaprb.com/blog/2005/09/23/how-to-write-a-sql-exclusion-join/

Fields that have shown up on the right-hand side of the join exist in both tables, and you can filter them out using a where clause.

No comments: