Home » SQL & PL/SQL » SQL & PL/SQL » How do I select the LAST RECORD of the Table?
How do I select the LAST RECORD of the Table? [message #1718] Fri, 24 May 2002 00:27 Go to next message
Mel
Messages: 7
Registered: May 2002
Junior Member
If I have a million records and I only want to select the last record inserted, how do I do that?
Re: How do I select the LAST RECORD of the Table? [message #1720 is a reply to message #1718] Fri, 24 May 2002 02:14 Go to previous message
John R
Messages: 156
Registered: March 2000
Senior Member
Unless you have a column on the table (or a related audit table) that records when the record was inserted, you can't.
Oracle will re-use space freed up by deleted rows to insert new ones., so there is no guarantee that the last row retrieved in an unordered select is the last row inserted.
Previous Topic: what is count(1)
Next Topic: what is dbms_sql
Goto Forum:
  


Current Time: Tue May 21 06:12:54 CDT 2024