MauricioSanRoman Posted December 24, 2006 Share Posted December 24, 2006 Hello Guys,I'm trying this all day with no result, aparently my mysql version don't accept subqueries, I read about using left joins to do a workaround, what I 'm trying to do without using a subquery is this statement:SELECT * FROM t1 WHERE t1.id NOT IN (SELECT t2.id FROM t2 where t2.field = '$phpvariable');Thanks and happy holidays! Quote Link to comment Share on other sites More sharing options...
Barand Posted December 24, 2006 Share Posted December 24, 2006 SELECT t1.* FROM t1 LEFT JOIN t2ON t1.id = t2.id AND t2.field = '$phpvariable'WHERE t2.id IS NULL Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.