Thread: Sort row

    #1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2004
    Posts
    94
    Rep Power
    16

    Sort row


    Is it possible to sort a row in mysql. I know I can do it in excel but not sure how to do it in mysql

    For example

    Column1 Column2 Column3
    0 2 1


    after sorting will be

    Column1 Column3 Column2
    0 1 2

    If you got idea please kindly telling me thanks.
  2. #2
  3. SQL Consultant
    Devshed Supreme Being (6500+ posts)

    Join Date
    Feb 2003
    Location
    Toronto Canada
    Posts
    27,127
    Rep Power
    4274
    Originally Posted by heroviper
    Is it possible to sort a row in mysql.
    no

    the best you can do is specify the columns in the order that you want

    if your columns are "sortable" then they are probably all the same type of data, in which case you should normalize
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

IMN logo majestic logo threadwatch logo seochat tools logo