I am trying to write a sub-query to select a subset of data from my database but it is not working. Can somebody take a quick look to see if there is something simple I'm missing? I have tried the subquery by itself and it works, as does the outside query with one value: IN(2384)...so something is wrong. Is this not supported by mysql?
SELECT * FROM Schools_equiv_request WHERE reg_id IN ( SELECT sr.id FROM Students_registration sr LEFT JOIN Programs_terms pt ON pt.id = sr.term_id LEFT JOIN Programs p ON p.id = pt.program_id WHERE p.school_id =88 )
Here's what phpmyadmin tells me:
MySQL said: Documentation
#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 'select sr . id from Students_registration sr LEFT JOIN Progra
Any help would be appreciated, I've been working on this for longer than I'd like to admit [img src=\"style_emoticons/[#EMO_DIR#]/wink.gif\" style=\"vertical-align:middle\" emoid=\":wink:\" border=\"0\" alt=\"wink.gif\" /]