id列的值为: 2,10,X,Y,D,G
我想这样分类: 2,10,D,G,X,Y
我尝试了很多解决方案,结果就在这里。
http://sqlfiddle.com/#!2/846ed/1
发布于 2014-01-08 13:03:57
您需要使用不同的排序值:
SELECT id
FROM test
ORDER BY (case when id REGEXP('(^[0-9]+$)') then 0 else 1 end),
cast(id as unsigned),
idhttps://stackoverflow.com/questions/20996048
复制相似问题