Home » RDBMS Server » Server Administration » i want to select the last record
i want to select the last record [message #50125] Fri, 01 March 2002 12:39 Go to next message
MANUEL
Messages: 10
Registered: August 1999
Junior Member
I want to select only the last record in a table, or only the highest (or the latest) number in a id Field....

sorry for the inexperience, and thanks
Re: i want to select the last record [message #50127 is a reply to message #50125] Fri, 01 March 2002 13:05 Go to previous message
saleem
Messages: 65
Registered: January 2002
Member
use the max function if you want the highest value of a particular record :
select max(column_name) from table_name;

and then

select * from table_name where
column_name = [[output of first query]];

you would be better off searching for the rowid in the first query, but if you are not familiar with them then just go about it this way.

if there is a date column that would have the tiem the record was created you could look for the latest in that as well.
Previous Topic: how to trace the history of sql excute
Next Topic: how to drop the rb file
Goto Forum:
  


Current Time: Tue Dec 24 19:53:36 CST 2024