SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: Doubt in Offset

Hybrid View

  1. #1
    SitePoint Zealot contactnaveen's Avatar
    Join Date
    Oct 2004
    Location
    India
    Posts
    169
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Doubt in Offset

    I have a table called "HelpingHands".

    I have many records in the table. [I dont know the total number of records it may increase or decrease]

    and i want to retrieve the last 1000 records in the table.

    i used select * from HelpingHands limit (ABC),1000;


    I dont know wot to substitute in the place of ABC.

    Any Idea??????


    Thanx in advance

    Cheers,
    Naveen.

  2. #2
    SitePoint Enthusiast
    Join Date
    Jun 2005
    Posts
    94
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You will have to order by a certain field
    (ie a datetime field, the primary key etc)
    and then limit the records
    Example with a datetime column
    Code:
    SELECT *
     FROM
      table
     ORDER BY
      datefield DESC
     LIMIT
      1000


Bookmarks

Posting Permissions

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