TimUSA Posted January 10, 2008 Share Posted January 10, 2008 whats wrong with this query? SELECT race_table.raceID, race_table.raceDate, pts_table.raceID, pts_table.skipperName, pts_table.position, pts_table.racePoints WHERE race_table.seriesID = '6' FROM race_table LEFT JOIN pts_table ON race_table.raceID = pts_table.raceID #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE race_table.seriesID = '6' FROM race_table LEFT JOIN pts_table ON race_ta' at line 1 my guess is i am doing the where wrong, because the query worked before i put it there? Quote Link to comment https://forums.phpfreaks.com/topic/85298-solved-mysql-question-syntax-error/ Share on other sites More sharing options...
btherl Posted January 10, 2008 Share Posted January 10, 2008 The order should be SELECT, FROM, LEFT JOIN, WHERE. The WHERE can't go before the FROM and the LEFT JOIN. Quote Link to comment https://forums.phpfreaks.com/topic/85298-solved-mysql-question-syntax-error/#findComment-435212 Share on other sites More sharing options...
teng84 Posted January 10, 2008 Share Posted January 10, 2008 where clause should be at the end of your select statement SELECT race_table.raceID, race_table.raceDate, pts_table.raceID, pts_table.skipperName, pts_table.position, pts_table.racePoints FROM race_table LEFT JOIN pts_table ON race_table.raceID = pts_table.raceID WHERE race_table.seriesID = '6' beaten to that any way there you go Quote Link to comment https://forums.phpfreaks.com/topic/85298-solved-mysql-question-syntax-error/#findComment-435214 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.