I have a query like (MS ACCESS).
The number values in the IN caluse is a variant.In the given example I given only 4.somethimes its more than 30 numbers.
SELECT ID
FROM TableName
WHERE (ID IN (16, 18, 15, 20 ))
Result : 15 ,16,18,20
Is there any way to retrieve values In the same order of values given in IN caluse.
Result should like this Result : 16,18,15,20
There is no way to tell the db engine to examine the order of values in the
IN()list and apply that same order to theORDER BY.You could apply the same ordering by using a
Switch()expression, but then you would have to keepSwitch()andIn()synchronized.