MySql Order By multiple columns BUGGY?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Cappamontana
    New Member
    • Sep 2007
    • 21

    MySql Order By multiple columns BUGGY?

    Hi there,

    Now I've read the ORDER BY section of the mysql documentation, but still have no clue, what strategy I have to follow now.
    The problem is that I want to query the DB like:
    [CODE=mysql]SELECT * FROM tr WHERE report_id='a408 58a6-d286-9d34-1ada-47e116c72699' ORDER BY pr DESC,loc DESC,DMZ DESC,url ASC,os ASC [/CODE]
    But after the second ORDER BY statement every other ORDER BY statement is being ignored. My primary keys are report_id,keywo rd and url.
    The table itself is not immense big (300 records) and my only index is report_id.
    Whats the clue? I can load everything in a php array and use array_sort on each column or maybe I can use other mysql tricks but I want to do it right and cant figure out why MySql is bugging us with this...?

    Any ideas? Tnx...
    Last edited by mwasif; Mar 20 '08, 08:47 PM. Reason: Replaced [PHP] with [CODE=mysql]
  • mwasif
    Recognized Expert Contributor
    • Jul 2006
    • 802

    #2
    MySQL multiple column ORDER BY is not buggy, you might getting it wrong. Can you show some data, the result that mysql is returning and the required output you want?

    Comment

    Working...