25 June 2009

Special ORDER BY handling without accepting any default sorting option of DB

select * from users where id in (11,10) order by field (id,11,10);

SELECT * FROM "comments" WHERE ("comments"."id" IN (1,3,2,4))
ORDER BY CASE "comments"."id"

No comments: