MySQL-按字母顺序对所有数据进行排序,但最后放置一个特定项 [英] MySQL - Ordering all data in alphabetical order but placing a particular item last

查看:75
本文介绍了MySQL-按字母顺序对所有数据进行排序,但最后放置一个特定项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我具有以下字段数据:

Assuming I have the following, data from a field:

Category Name
-------------

Games
Movies
All
Music
Software

我想按字母顺序(升序)对以上数据进行排序,但我希望全部"出现在列表底部.不确定如何执行此操作.谢谢.

I want to order the above data in alphabetical (ascending) order but I want 'All' to appear last at the bottom of the list. Not sure how to do this. Thanks.

推荐答案

ORDER BY category_name='All' ASC, category_name ASC

这篇关于MySQL-按字母顺序对所有数据进行排序,但最后放置一个特定项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆