Go to the last record

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • LuiePL
    New Member
    • Sep 2006
    • 24

    Go to the last record

    How can I go to the last record of database? I've been having problems after creating a new record, and trying to display it, but I don't know what primary ID it's given, so I dont know how to go the last record. Thanks for the help.
  • agocurti
    New Member
    • Sep 2006
    • 6

    #2
    Originally posted by LuiePL
    How can I go to the last record of database? I've been having problems after creating a new record, and trying to display it, but I don't know what primary ID it's given, so I dont know how to go the last record. Thanks for the help.
    if you want to find the last record in a table (with PK = xx) you can to try with:

    select * from tabv where xx = (select max(xx) from tab)

    Comment

    • LuiePL
      New Member
      • Sep 2006
      • 24

      #3
      Many thanks!!!!

      Comment

      • ramasp
        New Member
        • Sep 2006
        • 19

        #4
        Hi,
        select top 1 * from tablename order by column name desc

        Comment

        Working...