Results 1 to 3 of 3

Thread: [RESOLVED] SQL - skip first row

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2004
    Posts
    121

    Resolved [RESOLVED] SQL - skip first row

    Hello all.
    I'm using PHP & MySQL. The following works, but I would like to skip the first row.
    Code:
    $sql = mysql_query('SELECT time_id FROM posts WHERE thread_id=1');
    Any help is appreciated.
    Many thanks.
    Last edited by solitario; Aug 9th, 2005 at 11:56 PM.

  2. #2
    Member
    Join Date
    Mar 2005
    Posts
    56

    Re: SQL - skip first row

    You can use the limit clause:
    Quote Originally Posted by mysql manual
    To retrieve all rows from a certain offset up to the end of the result set, you can use some large number for the second parameter. This statement retrieves all rows from the 96th row to the last:

    mysql> SELECT * FROM table LIMIT 95,18446744073709551615;
    You could change yours to start at 1 instead of 95.
    Link to that information

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jul 2004
    Posts
    121

    Re: SQL - skip first row

    Excellent, thank you!

Posting Permissions

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



Click Here to Expand Forum to Full Width