Re: MySQL Sort by Array

2008-10-23 Thread Moon's Father
Just staightly use ... in .. is ok. On Fri, Oct 24, 2008 at 12:57 AM, Bill Newton <[EMAIL PROTECTED]>wrote: > Pretty standard mysql function. Its been in mysql for a while. > > http://dev.mysql.com/doc/refman/4.1/en/string-functions.html#function_field > > > > > Jim Lyons wrote: > >> I'm not fami

Re: MySQL Sort by Array

2008-10-23 Thread Bill Newton
Pretty standard mysql function. Its been in mysql for a while. http://dev.mysql.com/doc/refman/4.1/en/string-functions.html#function_field Jim Lyons wrote: I'm not familiar with "order by field" (unless field is a UDF). I know of order by binary. Is this standard mysql syntax? On Wed, Oct

Re: MySQL Sort by Array

2008-10-22 Thread Uwe Kiewel
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Keith Spiller schrieb: > 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' what about ... WHERE id in (5, 9, 25, 34) ... > ORDER BY id(5, 34, 9, 25) like the others said

Re: MySQL Sort by Array

2008-10-22 Thread Rob Wultsch
http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_field it is ORDER BY ... and in this case the ... is the function described above. On Wed, Oct 22, 2008 at 12:24 PM, Jim Lyons <[EMAIL PROTECTED]> wrote: > I'm not familiar with "order by field" (unless field is a UDF). I kno

Re: MySQL Sort by Array

2008-10-22 Thread Jim Lyons
I'm not familiar with "order by field" (unless field is a UDF). I know of order by binary. Is this standard mysql syntax? On Wed, Oct 22, 2008 at 10:42 AM, Peter Brawley <[EMAIL PROTECTED] > wrote: > ORDER BY id(5, 34, 9, 25) >> Can anyone tell me the proper syntax to accomplish this task? >> >

Re: MySQL Sort by Array

2008-10-22 Thread Peter Brawley
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

MySQL Sort by Array

2008-10-22 Thread Keith Spiller
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