Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: Order By

  1. #1
    New Coder
    Join Date
    Dec 2005
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Order By

    I have a column called `type`, the value for each row is one of 12 possibilities. Is there a way to have the query results sorted according to the type besides the normal alphabetical sort?

    Ex, have the results shown in this order: boots, body, orbs, augments.

  • #2
    Super Moderator guelphdad's Avatar
    Join Date
    Mar 2006
    Location
    St. Catharines, Ontario Canada
    Posts
    2,631
    Thanks
    4
    Thanked 147 Times in 138 Posts
    Code:
    order by field(fieldname,'boots', 'body', 'orbs', 'augments')
    note you can only use this in mysql it isn't standard sql.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •