Wednesday, March 7, 2012

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.

Quote:

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)|||Many thanks!!!!|||Hi,
select top 1 * from tablename order by column name desc

No comments:

Post a Comment