List:General Discussion« Previous MessageNext Message »
From:Papalagi Pakeha Date:October 30 2007 11:35am
Subject:Re: Sort results by order in list
View as plain text  
On 10/30/07, Johan Höök <johan.hook@stripped> wrote:
> Hi,
> what you probably want is
> SELECT id, start_date FROM iddt WHERE id IN
> ('109k7','s3x6','sxmns','wt57')
> ORDER BY FIELD(id,'109k7','s3x6','sxmns','wt57')

That's exactly it! Thanks a lot :-)

Just for the record, here's the FIELD() function description:
http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_field

PaPa
Thread
Sort results by order in listPapalagi Pakeha30 Oct
  • Re: Sort results by order in listPeter Brawley30 Oct
    • Re: Sort results by order in listPapalagi Pakeha30 Oct
      • Re: Sort results by order in listPeter Brawley30 Oct
  • Re: Sort results by order in listSebastian Mendel30 Oct
    • Re: Sort results by order in listPapalagi Pakeha30 Oct
      • Re: Sort results by order in listJohan Höök30 Oct
        • Re: Sort results by order in listPapalagi Pakeha30 Oct