tags:

views:

26

answers:

2

Hi,

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?

+5  A: 

ORDER BY ColumnName = 'Other', ColumnName

Hammerite
A: 

if 'Other' is not present in Table USE

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