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! Link to comment https://forums.phpfreaks.com/topic/31741-solved-workaround-for-subqueries/ 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 Link to comment https://forums.phpfreaks.com/topic/31741-solved-workaround-for-subqueries/#findComment-147264 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.