Thread: Order By...

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

    Join Date
    Jul 2000
    Location
    England, UK
    Posts
    83
    Rep Power
    15
    I have a mySQL table, I have an auto_increment column. I want to be able to select and order the results, eg:

    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>
    SELECT * FROM table ORDER BY id
    [/code]

    but I don't want to order like this. I want to order backwards. eg.

    With the code above it will display 1,2,3 - I want 3,2,1

    Does anyone know how I'd do this?

    Thanks

    ------------------
    Girish Gupta
    MusicGoesOn.com
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Location
    Seaside, CA
    Posts
    84
    Rep Power
    15
    ORDER BY id DESC

    ------------------
    From the day we're born, we're running out of time.
  4. #3
  5. No Profile Picture
    Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Location
    England, UK
    Posts
    83
    Rep Power
    15
    Thanks

    ------------------
    Girish Gupta
    MusicGoesOn.com

Similar Threads

  1. What do you use as a unique order id?
    By starlightcj in forum PHP Development
    Replies: 5
    Last Post: February 7th, 2004, 09:07 AM
  2. Generating external js subcategory list from MySQL using PHP
    By NanoEntity in forum PHP Development
    Replies: 4
    Last Post: December 15th, 2003, 09:50 AM
  3. bug with nested order bys
    By cablehead in forum MS SQL Development
    Replies: 2
    Last Post: October 27th, 2003, 03:57 PM
  4. Referrer tool for order form?
    By savantmg in forum PHP Development
    Replies: 4
    Last Post: September 19th, 2003, 01:45 PM
  5. Forcing key read in reverse order?
    By lanzer in forum MySQL Help
    Replies: 7
    Last Post: September 15th, 2003, 09:19 PM

IMN logo majestic logo threadwatch logo seochat tools logo