MySQL ORDER BY Customized
问题 I have these rows y DB and I would like order by but in the below order with caracters and number. The colum Score is a varchar. WINNER and LOSER are in Score colum also. Score WINNER 100+ 100 90 80+ 80 50 LOSER 回答1: This approach converts the score value to a number when ordering. I tried it with your data, then with your data plus additional values, and it worked both times: SELECT score FROM myTable ORDER BY CASE WHEN score = 'WINNER' THEN 100000 WHEN score = 'LOSER' THEN -100000 WHEN