List:General Discussion« Previous MessageNext Message »
From:Peter Brawley Date:February 12 2006 6:58pm
Subject:Re: arbitrary ORDER BY
View as plain text  
Steve,

 >I have a project where I need to sort rows by an arbitrary order.
 >I seem to recall at some point where I was able to do some SQL like:

 >ORDER BY
 >    type = "the first type",
 >    type = "another type",
 >    type = "yes another arbitrary type" ...

Check out the FIELD() function.

PB

-----

Steve Lefevre wrote:
> Hey folks -
>
> I have a project where I need to sort rows by an arbitrary order. I 
> seem to recall at some point where I was able to do some SQL like:
>
> ORDER BY
>     type = "the first type",
>     type = "another type",
>     type = "yes another arbitrary type" ...
>
> However, my arbitrary ORDER BY statements don't seem to be working on 
> MySQL 5.0.16.
>
> Am I remembering correctly? I can't seem to find anything in the MySQL 
> manual.
>
> Steve
>


-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.375 / Virus Database: 267.15.6/257 - Release Date: 2/10/2006

Thread
arbitrary ORDER BYSteve Lefevre12 Feb
  • Re: arbitrary ORDER BYPeter Brawley12 Feb
  • Re: arbitrary ORDER BYHarald Fuchs13 Feb
Re: arbitrary ORDER BYSteve Lefevre13 Feb