ORDER BY in subquery not working
Posted: Thu Mar 24, 2011 8:03 am
Table A contains columns photo and id
Table B contains columns id, other_id and rank (primary index on id and other_id)
The following query correctly returns the result I want, except that it ignores my request to order by rank, and I need it to do that.
SELECT photo FROM A WHERE id= ANY(SELECT id FROM B WHERE other_id='$other_id')
Any suggestions?
Table B contains columns id, other_id and rank (primary index on id and other_id)
The following query correctly returns the result I want, except that it ignores my request to order by rank, and I need it to do that.
SELECT photo FROM A WHERE id= ANY(SELECT id FROM B WHERE other_id='$other_id')
Any suggestions?