Forum Moderators: coopster
If all values are constants, then all values are evaluated according to the type ofand sorted. The search for the item is then done using a binary search. This means IN is very quick if the IN value list consists entirely of constants.expr
SELECT * FROM table WHERE number IN (2,1,3) ORDER BY number=2 DESC, number=1 DESC, number=3 DESC;