Link Posted July 10, 2009 Share Posted July 10, 2009 SELECT users.id, users.first_name, users.last_name, guides.mit_id FROM guides, schedules_private AS sch LEFT JOIN users ON guides.user_id = users.id WHERE sch.user_id = users.id AND ( (sch.week = '2009-06-29' AND sch.day >= '3') OR ( sch.week > '2009-06-29' AND sch.week <= '2010-06-28' AND sch.day <= '3' ) ) Why is this giving me u.id is an unknown column? Quote Link to comment https://forums.phpfreaks.com/topic/165550-solved-tricky-query-2/ Share on other sites More sharing options...
MadTechie Posted July 10, 2009 Share Posted July 10, 2009 Well u.id isn't in that statement So MySQL shouldn't give any message about u.id Quote Link to comment https://forums.phpfreaks.com/topic/165550-solved-tricky-query-2/#findComment-873220 Share on other sites More sharing options...
Zane Posted July 10, 2009 Share Posted July 10, 2009 SELECT users.id, users.first_name, users.last_name, guides.mit_id FROM guides, schedules_private AS sch LEFT JOIN users ON guides.user_id = users.id WHERE sch.user_id = users.id AND ( /// (sch.week = '2009-06-29' AND sch.day >= '3') OR ( sch.week > '2009-06-29' AND sch.week ) ) Quote Link to comment https://forums.phpfreaks.com/topic/165550-solved-tricky-query-2/#findComment-873233 Share on other sites More sharing options...
fenway Posted July 15, 2009 Share Posted July 15, 2009 Solved how? This is a precedence issue. Quote Link to comment https://forums.phpfreaks.com/topic/165550-solved-tricky-query-2/#findComment-876100 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.