Roger Baklund wrote:
Harish wrote:

Hi,

I apprecaite anybody replying me with an equvalent query for this:
I am using mysql 4.0.21


select a.address from a where a.id not in (select b.iid from b where b.message='y')


This can be done with a left join:

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;

Michael

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



Reply via email to