Thread: Last xx Records

  1. No Profile Picture
    Devshed Newbie (0 - 499 posts)
    I am trying to figure out a way to write a query that would select the last ten files that have been created in a table. The table has a Primary Key (just an auto_increment integer). The table also has a column containing the timestamp of each file also.

    Also I would like to be able to use a limit function such as LIMIT 5,10 (and variations of this), while I assume this would be the same as any other select I figured I should include it just in case that would change the parameters of the query.

    Luke Bowerman
    new media arts

  2. #2
  3. No Profile Picture
    Devshed Newbie (0 - 499 posts)

    SELECT * FROM mytable ORDER BY date_column DESC LIMIT 10;

Similar Threads

  1. Replies: 0
    Last Post: July 22nd, 2003, 08:56 AM
  2. zero records...
    By PhilgB in forum MySQL Help
    Replies: 2
    Last Post: May 7th, 2002, 07:43 AM
  3. printing records via loop with restrictions
    By bakedbean in forum PHP Development
    Replies: 5
    Last Post: January 29th, 2002, 12:15 AM
  4. Selecting unmatched records?
    By SilkySmooth in forum MySQL Help
    Replies: 5
    Last Post: October 18th, 2001, 11:49 AM
  5. 909 records, last 9 records ignored w/ SELECT query
    By mstembri in forum PHP Development
    Replies: 2
    Last Post: September 4th, 2000, 09:14 AM

IMN logo majestic logo threadwatch logo seochat tools logo