开发者

MySQL - ordering alphabetically except for one entry?

I have to sort a list of categories using MySQL as I am using a CMS that only allows this. Is there a way to sort alphabetically but to return one entry ("Other") at the 开发者_开发技巧end of the list?


ORDER BY ColumnName = 'Other', ColumnName


if 'Other' is not present in Table USE

(SELECT name FROM categories ORDER BY name)
UNION
(SELECT "Other")
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜