Database Custom Sort Order

Dark King

I want to order the role of the members. Like :

Leaders 
Co Leaders
Elders
Members

But when I use ORDER BY, it orders according to the alphabet. That is :

Co Leaders
Elders 
Leaders
Members

Is it possible to do the sorting like that?

potashin

You can try to ORDER with FIELD :

ORDER BY FIELD(your_field, 'Leaders' , 'Co Leaders', 'Elders', 'Members')

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related