List:General Discussion« Previous MessageNext Message »
From:Uwe Kiewel Date:October 22 2008 8:55pm
Subject:Re: MySQL Sort by Array
View as plain text  
-----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

>
> Can anyone tell me the proper syntax to accomplish this task?
>
> Thanks for your help.
>
> Keith

Uwe

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iQIcBAEBAgAGBQJI/5MmAAoJEEJXG7BUuynnkQAQAIfGGw+KpMukrwZcGEO39W+7
kBYpKqGlEWKSO1fWQNWDoXFACzhJP/gnBaBqHjVxe80rkuKFukfpA0+yZ0GBERUN
boNq+qiHG5Cr5DTHyQ/FQg5vQj5sO4V+iR5yBjUxYzpGPGPpNB2PHAeV1MorOTBX
MfJJpRmK+oT60rE4kpsTzozpk31si5kVU7QW/Z3tGLQlyYcldEBLvBMjO9iS9uFF
OmFbcRcA3goRjKiIV7B9Ps17rnFneezYD8WXlamxl5hf0/fih5xf/iIBKdpmvtZO
iaMM/HkrCVllWFOTxOfXBTLSDBlQPi8NjGiqJ5DUYD0KvrSPF8nrSZdqJUMlcl33
25tYUzM4mp/AxszGqtD5R/USVFecWKz1sF3UVjIDN/1cSvLN+Eq+S1cGGsFImsgl
CZaXW7crGPZyu2DvnrXp74btCMf0y/N6etT6xiQArl2R0YjiDncHcmASH+VmmTwR
W9XIX5mIaAEKz8bsQXZKZ9Vb2Mbf5oz4cD3DH2rNfQSDK6zL4qcpbylhLwOJMX+W
DR43GaIkJuv/myjfDK1Q+clBoaI13OB13TaagGOC6nHZTFGTg6aurVXq2uWCOG4r
G7l7HdrnQwO8VbmjiGYVI6w/mLl7/dBUwhkIJhOgbeqJMYTMMrS5x3si/Y8W2iz5
qNJ16hL29Rd8XlIRdG8W
=wRny
-----END PGP SIGNATURE-----
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