这是我的查询:
SELECT * FROM `players`
WHERE `team` = '$team'
ORDER BY `spot` ASC,
CASE WHEN
`spot` LIKE '%LW%' THEN '1'
WHEN `spot` LIKE '%C%' THEN '2'
WHEN `spot` LIKE '%RW%' THEN '3'
END
我的目标是通过以下方式订购
:答案 0 :(得分:0)
尝试以下
SELECT * FROM `players`
WHERE `team` = '$team'
ORDER BY cast(spot as unsigned),
CASE WHEN
`spot` LIKE '%LW%' THEN '1'
WHEN `spot` LIKE '%C%' THEN '2'
WHEN `spot` LIKE '%RW%' THEN '3'
END