I can use
SELECT * FROM table
WHERE id IN (478,278,190,890,123)
to return a list of records.
How can I instruct SQLite to return the records sorted using the order as specified in the list?
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.
There is no dedicated instruction to such thing.
You have to find a solution for each case.
In your example, you can do it like this:
But if you have a long list of ids, it will become difficult to maintain.