From: Peter Brawley Date: October 22 2008 3:42pm Subject: Re: MySQL Sort by Array List-Archive: http://lists.mysql.com/mysql/214998 Message-Id: <48FF49EB.4040607@earthlink.net> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="------------070300040408010701030607" --------------070300040408010701030607 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit >ORDER BY id(5, 34, 9, 25) >Can anyone tell me the proper syntax to accomplish this task? ORDER BY FIELD( id, 5, 34, 9, 25 ) PB ----- Keith Spiller wrote: > Hi Guys, > > I'm trying to sort by a particular order: > > SELECT * FROM tablename > WHERE id='5' OR id='9' OR id='25' OR id='34' > ORDER BY id(5, 34, 9, 25) > > Can anyone tell me the proper syntax to accomplish this task? > > Thanks for your help. > > Keith > > ------------------------------------------------------------------------ > > > No virus found in this incoming message. > Checked by AVG - http://www.avg.com > Version: 8.0.175 / Virus Database: 270.8.2/1739 - Release Date: 10/22/2008 7:23 AM > > --------------070300040408010701030607--