Hi All,

Sorry, I got a autoreply from [EMAIL PROTECTED] I was not able
to understand the autoreply and thought that the mail bouced. Please ignore
my duplicate mail.


Thanks again,
Harish

-----Original Message-----
From: Roger Baklund [mailto:[EMAIL PROTECTED]
Sent: Monday, January 31, 2005 6:15 PM
To: mysql
Cc: Michael Stassen
Subject: Re: Need a query to get the difference of two tables


Michael Stassen wrote:
>
> Roger Baklund wrote:
[...]
>> select a.address
>>   from a
>>   left join b on b.iid=a.id
>>   where b.iid is null;
>
>
> That's not equivalent, because it leaves out a condition.  I think it
> should be
>
>   SELECT a.address
>   FROM a
>   LEFT JOIN b ON a.id = b.iid AND b.message='y'
>   WHERE b.iid IS NULL;

You are of course right, thank you! :)

...and the important thing here is to put this extra condition in the ON
clause, not in the WHERE clause.

--
Roger


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to