Home » SQL & PL/SQL » SQL & PL/SQL » How to get last row from a table in Oracle through SQL query
|
|
|
|
|
|
Re: How to get last row from a table in Oracle through SQL query [message #28314 is a reply to message #28240] |
Mon, 15 December 2003 18:14  |
Yogeshwar Sharma
Messages: 2 Registered: December 2003
|
Junior Member |
|
|
Hi!
you can use this SQL statement to get last row from a table.
select col1,col2,col3... from
(select col1,col2,col3...,rownum pos from table_name)
where pos = (select max(pos) from (select col1,col2,col3...,rownum pos from table_name))
where col1,col2..are the fields of the table and pos will give u the position of a record.
You can use this SQL to get record at any position in a table
Cheers.
|
|
|
Goto Forum:
Current Time: Thu Jun 05 23:01:13 CDT 2025
|