4

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?

2 Answers 2

15

ORDER BY ColumnName = 'Other', ColumnName

0

if 'Other' is not present in Table USE

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.