I have a simple SQL query (in PostgreSQL 8.3) that grabs a bunch of comments. I've composed a bunch of ids before-hand and that gets fed into the WHERE IN clause like so...
SELECT * FROM "comments" WHERE ("comments"."id" IN (1,3,2,4))
This returns the comments in a natural order which in my case is the ids like 1,2,3,4.
What I'm wanting is to sort the returned rows in the order supplied by the IN clause (1,3,2,4).
How can I ORDER BY the IN clause value list?