[thelist] Ordering a recordset by an array

rudy rudy937 at rogers.com
Tue Oct 14 15:01:41 CDT 2003


> Thing o' beauty, Rudy

thanks

you should see it in MySQL, where you can put boolean expressions into the ORDER BY --

  select * from rudy_elements
   where id in (17,5,10)
   order by 
     id=17  desc
   , id=5   desc
   , id=10  desc

note the boolean expressions evaluate to 1 or 0, which
works the same as the CASE structure, only cuter...

... assuming you like cute code (i normally don't)

rudy



More information about the thelist mailing list