SELECT table1.* FROM table1, table2 WHERE table1.item_id=table2.item_id
That way, you only get rows for each item_id that exists in both tables, which was the point, with no need to filter the extra stuff the LEFT JOIN would have created.
Michael
Brent Baisley wrote:
IN is supported in 4.1, I'm not sure about 4.0. But any, you can do you query like this:
select table1.* from table1 left join table2 on table1.item_id=table2.item_id where table2.item_id is not null
I think that's right. It may actually be quicker than using IN.
On Feb 6, 2004, at 2:20 PM, Scott Purcell wrote:
I am trying to run the below query, and believe that the 'IN' is not supported in mysql. What is the 'IN' replacement? I tried exists and that doesn't work.
select * from table1 where item_id IN (select item_id from table2)
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]