Assuming I have the following, data from a field:
开发者_JAVA百科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
SELECT Category_Name, if(Category_Name='All',1,0) as orderAid
FROM CategoryTable
ODER BY orderAid, Category_Name
精彩评论