SELECT *, code AS Expr1
FROM ss
WHERE code in ('200151642','200151655','200151559','200151568')
order by case code when '200151642' then 1 when '200151655' then 2 when '200151559' then 3 when '200151568' then 4 end
FROM ss
WHERE code in ('200151642','200151655','200151559','200151568')
order by case code when '200151642' then 1 when '200151655' then 2 when '200151559' then 3 when '200151568' then 4 end
SELECT *, code AS Expr1
FROM ss
WHERE code in ('200151642','200151655','200151559','200151568')
order by right(code, 2);
FROM ss
WHERE (code = '200151642')or
(code = '200151655')or
(code = '200151559')or
(code = '200151568')
order by case code when '200151642' then 1 when '200151655' then 2 when '200151559' then 3 when '200151568' then 4 end