40esp Posted June 14, 2008 Share Posted June 14, 2008 Im trying to query mysql with two inner join statements. Currently I have: SELECT * FROM careers INNER JOIN practice_groups ON careers.practice_id = practice_groups.group_id INNER JOIN offices ON careers.office_id = offices.office_id WHERE career.career_id = 1 ORDER BY 'date' DESC But mysql is throwing errors, I've tried parenthesis, but that didn't work, I probably put them in the wrong place. Any Ideas? Link to comment https://forums.phpfreaks.com/topic/110161-solved-inner-join/ Share on other sites More sharing options...
bluejay002 Posted June 14, 2008 Share Posted June 14, 2008 i think you are i na wrong forum.. .there's a separate forum for MySQL. though i dont have that modo powers to move threads. anyway... what error did it show? in your query: SELECT * FROM careers INNER JOIN practice_groups ON careers.practice_id = practice_groups.group_id INNER JOIN offices ON careers.office_id = offices.office_id -- instead of career.career_id, you forgot 's' WHERE careers.career_id = 1 -- date is a keyword for mysql so avoid using it -- also, specify which table 'date' field belong, it might be ambiguous to other 'date' fields you have ORDER BY 'date' DESC Link to comment https://forums.phpfreaks.com/topic/110161-solved-inner-join/#findComment-565346 Share on other sites More sharing options...
40esp Posted June 14, 2008 Author Share Posted June 14, 2008 its not because of that, i just freehanded the above as an example. Link to comment https://forums.phpfreaks.com/topic/110161-solved-inner-join/#findComment-565351 Share on other sites More sharing options...
bluejay002 Posted June 14, 2008 Share Posted June 14, 2008 can you post the error? Link to comment https://forums.phpfreaks.com/topic/110161-solved-inner-join/#findComment-565359 Share on other sites More sharing options...
40esp Posted June 14, 2008 Author Share Posted June 14, 2008 got it, Thanks. Link to comment https://forums.phpfreaks.com/topic/110161-solved-inner-join/#findComment-565364 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.