I have this clause:
SELECT *
FROM picture p
WHERE p.id IN (2, 1, 3)
When I execute it I get the 3 elements, but ordered by its ‘id’ (1,2,3).
What I want is to get the elements in base of the order I’m giving: 2,1,3.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Not really. You basically get an arbitrary order. No
ORDER BYclause means no reliable order.If you are building your SQL dynamically, you’ll have to do something like this: