Method to sort MYSQL results by an arbitriary letter (ie, show all rows starting with F first)

Posted by Buzz on Stack Overflow See other posts from Stack Overflow or by Buzz
Published on 2010-03-19T14:09:40Z Indexed on 2010/03/19 14:11 UTC
Read the original article Hit count: 139

Filed under:
|
|

I have a column of states, and, depending on the query, I want to order by results by a particular state, then by id (Asc or Desc, depending). For instance, I might want to show all rows with state "HI", sorted by ID desc, and then all the other rows, sorted by id desc.

I was hoping I could do this in one query, rather than getting all my favored state results, and then getting the rest. Can I?

© Stack Overflow or respective owner

Related posts about mysql

Related posts about sort