Your ORDER BY is inside your subselect and therefore useless to the final order of the results but is causing your error.
Move it outside the subselect.
SELECT id
FROM institute
WHERE member_id IN
( SELECT id
FROM MEMBER
WHERE id IN ( 765, 769, 753, 774, 778, 779, 781, 790,
799, 809, 820, 823, 855, 835, 839, 842,
845, 849, 850, 851 )
)
ORDER BY name ASC
N.B.: I can only assume that name is a column in the institute table as otherwise the ORDER BY would be totally redundant. Therefore it should be ordering the main SELECT.
or remove it entirely...
SELECT id
FROM institute
WHERE member_id IN
( SELECT id
FROM MEMBER
WHERE id IN ( 765, 769, 753, 774, 778, 779, 781, 790,
799, 809, 820, 823, 855, 835, 839, 842,
845, 849, 850, 851 )
)
Wouldn't this query be more efficient though?
SELECT i.id
FROM institute i
INNER JOIN member m
ON (i.member_id = m.id)
WHERE m.id IN ( 765, 769, 753, 774, 778, 779, 781, 790,
799, 809, 820, 823, 855, 835, 839, 842,
845, 849, 850, 851 )