Canman2005 Posted June 12, 2010 Share Posted June 12, 2010 Hi all Just wondering if someone can help me with with my SELECT query SELECT b.name, (SELECT value FROM options WHERE id = bc.level1) AS l1, (SELECT value FROM options WHERE id = bc.level2) AS l2, (SELECT value FROM options WHERE id = bc.level3) AS l3 FROM items b LEFT JOIN cats bc ON b.id = bc.item_id WHERE l3 = 'Apple' AND l3 = 'iPod' AND l3 = 'Touch' as I keep getting a #1054 - Unknown column 'l3' in 'where clause' But I cannot figure it out Any help would be great Thanks Link to comment https://forums.phpfreaks.com/topic/204593-help-with-query/ Share on other sites More sharing options...
Canman2005 Posted June 12, 2010 Author Share Posted June 12, 2010 Any ideas anyone? Link to comment https://forums.phpfreaks.com/topic/204593-help-with-query/#findComment-1071247 Share on other sites More sharing options...
fenway Posted June 15, 2010 Share Posted June 15, 2010 "l3" is a table alias -- not a column. Link to comment https://forums.phpfreaks.com/topic/204593-help-with-query/#findComment-1072355 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.