I know that I can select multiple lines, for example:
select * FROM table WHERE id in (1, 2, 3, 10, 100);
And I get the results returned in order: 1, 2, 3, 10, 100
But what if I need to return the results in a specific order? When I try this:
select * FROM table WHERE id in (2, 100, 3, 1, 10);
I still get the results returned in the same order: 1, 2, 3, 10, 100
Is there a way to get the results returned in the order I require?
(There are limitations related to how the site is configured, which will not allow me to ORDER BY using a different field value)
Jeff schram
source
share