sort on column type enum
am 26.09.2006 16:56:20 von iavianHi 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
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
SELECT * FROM table ORDER BY enumcol IN ('DL','H','A'), enumcol;
See Imran Chaudhry's post at
http://dev.mysql.com/doc/refman/5.1/en/select.html
vjyanand@gmail.com wrote:
> 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