By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,831 Members | 1,031 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,831 IT Pros & Developers. It's quick & easy.

Go to the last record

LuiePL
P: 24
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.
Sep 19 '06 #1
Share this Question
Share on Google+
3 Replies


P: 6
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)
Sep 19 '06 #2

LuiePL
P: 24
Many thanks!!!!
Sep 20 '06 #3

P: 19
Hi,
select top 1 * from tablename order by column name desc
Sep 21 '06 #4

Post your reply

Sign in to post your reply or Sign up for a free account.