sort on column type enum

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Hi all

I have a column of type enum('A', 'AP', 'CR', 'D', 'DL', 'H', 'HD',
'HH', 'R', 'S', 'PL'). i want to sort the result by 'DL', 'H','A',and
the rest .

Thanks in advance

Re: sort on column type enum

SELECT * FROM table ORDER BY enumcol IN ('DL','H','A'), enumcol;

See Imran Chaudhry's post at wrote:
Quoted text here. Click to load it

Site Timeline