Reputation: 3163
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.
Upvotes: 1
Views: 2074
Reputation: 680
SELECT Category_Name, if(Category_Name='All',1,0) as orderAid
FROM CategoryTable
ODER BY orderAid, Category_Name
Upvotes: 1