List:General Discussion« Previous MessageNext Message »
From:Moon's Father Date:October 24 2008 5:42am
Subject:Re: MySQL Sort by Array
View as plain text  
Just staightly use ... in .. is ok.

On Fri, Oct 24, 2008 at 12:57 AM, Bill Newton
<bnewton@stripped>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 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 <
>> peter.brawley@stripped
>>
>>
>>> wrote:
>>>
>>>
>>
>>
>>
>>> 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
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>
>>
>>
>
>
> --
> Bill Newton
> Network Merchants Inc.
> http://www.nmi.com
> (847) 352-4850 ext 141/ Tel
> (888) 829-3631/ Fax
>
>
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:
> http://lists.mysql.com/mysql?unsub=1
>
>


-- 
I'm a MySQL DBA in china.
More about me just visit here:
http://yueliangdao0608.cublog.cn

Thread
MySQL Sort by ArrayKeith Spiller22 Oct
  • Re: MySQL Sort by ArrayPeter Brawley22 Oct
    • Re: MySQL Sort by ArrayJim Lyons22 Oct
      • Re: MySQL Sort by ArrayRob Wultsch22 Oct
      • Re: MySQL Sort by ArrayBill Newton23 Oct
        • Re: MySQL Sort by ArrayMoon's Father24 Oct
Re: MySQL Sort by ArrayUwe Kiewel22 Oct