Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2005
    Posts
    2

    Unanswered: Is there an equivalent syntax to TOP IN SQL?

    Hi everyone, I am new to SQL, and would really appreciate help with this.

    I have a database with the following fields:
    IDNumber: sequential running from 1 to approx 50000
    SURNAME: Surname
    FNAME: Forename.

    I want to return the last 100 IDNUmbers and return the surname and fname associated with the IDNumbers.
    When I try TOP it gives me IDNumbers 1 to 100, is there an equilvant for the bottom 100 numbers.
    Please help if you can.
    Thanks
    Scott

  2. #2
    Join Date
    Jun 2004
    Location
    Arizona, USA
    Posts
    1,848
    Return the top 100, but just order by IDNumbers DESC
    Lou
    使大吃一惊
    "Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
    "I have my standards. They may be low, but I have them!" - Bette Middler
    "It's a book about a Spanish guy named Manual. You should read it." - Dilbert


  3. #3
    Join Date
    Nov 2005
    Posts
    2
    Thank you so much, I would never have worked that out.
    And DESC stands for descending !? Fab!
    Thanks again, I owe you a beer.

    Scott

Posting Permissions

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