[RESOLVED] MySQL: ORDER BY ENUM value?
Hello all.
I know that if you use an ENUM field, you can use ASC or DESC in an ORDER BY clause (which works great with two possible values)... But what if your ENUM field has three or more possible values?
For instance, let us say I have an ENUM field:
Code:
marital_status ENUM('H','W','N')
And I wanted to order the recordset, first by showing records where the value of the ENUM is "H", then records where the value is "W" followed by records where the value is "N". Is this even possible?
Many thanks to anyone who can figure this one out.
Re: MySQL: ORDER BY ENUM value?
Seems to be working. For those interested:
Code:
ORDER BY
marital_status="H",
marital_status="W",
marital_status="N"