From: Peter Brawley Date: February 28 2005 6:37pm Subject: Re: Fwd: how can I do instead of using subselects? List-Archive: http://lists.mysql.com/mysql/180681 Message-Id: <422364EF.3030408@earthlink.net> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Joppe, >Another question is how do I do when I want to compare two tables, >normally is it no problem to get a list with rows that exist i both >tables, but how do I do if I want to to have the diffrence listed >instead, the rows that only appears in one of the tables? SELECT * FROM tblA LEFT JOIN tblB ON tblA.key=tblB.key WHERE tblB.key IS NULL; returns the rows of tblA for which there is no tblB row with a matching key value. Peter Brawley http://www.artfulsoftware.com -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.300 / Virus Database: 266.5.2 - Release Date: 2/28/2005