List:General Discussion« Previous MessageNext Message »
From:Peter Brawley Date:February 28 2005 6:37pm
Subject:Re: Fwd: how can I do instead of using subselects?
View as plain text  
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

Thread
Fwd: how can I do instead of using subselects?Joppe A28 Feb
  • Re: Fwd: how can I do instead of using subselects?Peter Brawley28 Feb