From: Peter Brawley Date: January 23 2006 3:49pm Subject: Re: Comparing 2 Tables List-Archive: http://lists.mysql.com/mysql/194141 Message-Id: <43D4FAF4.8040103@earthlink.net> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Andrew, >I need to update a table without disturing the recordset however there are >or could be some overlaps with data is there a way I can compare id fro >the same 2 tables, one new one old? Here's one way... SELECT MIN(TableName) as TableName, id FROM ( SELECT 'Table a' as TableName, a.id FROM a UNION ALL SELECT 'Table b' as TableName, b.id FROM b ) AS tmp GROUP BY id HAVING COUNT(*) = 1 ORDER BY id; PB -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.14.22/238 - Release Date: 1/23/2006