order by 会先执行后面的 子句
例1:
ORDER BY
case DisplaySize
when 'S' then 1
when 'M' then 2
when 'L' then 3
when 'XL' then 4
when 'XXL' then 5
when '3XL' then 6
end
例2
String s = "SELECT * FROM EVENT WHERE eventId IN(443,419,431,440,420,414,509) ORDER BY INSTR(',443,419,431,440,420,414,509,',CONCAT(',',eventId,','))";
select * from user order by field(roleId,2,3,4,1,5);