Home » SQL & PL/SQL » SQL & PL/SQL » Last N rows of a table (renamed + merged)
icon5.gif  Last N rows of a table (renamed + merged) [message #264213] Sun, 02 September 2007 01:29 Go to next message
sadiqss
Messages: 2
Registered: August 2007
Junior Member
How do I find last n rows from a table?

[Updated on: Tue, 04 September 2007 08:32] by Moderator

Report message to a moderator

icon5.gif  Query [message #264214 is a reply to message #264213] Sun, 02 September 2007 01:39 Go to previous messageGo to next message
sadiqss
Messages: 2
Registered: August 2007
Junior Member
How do i find the last n rows from a table?

[Updated on: Tue, 04 September 2007 08:32] by Moderator

Report message to a moderator

Re: Query [message #264219 is a reply to message #264213] Sun, 02 September 2007 02:09 Go to previous messageGo to next message
Frank Naude
Messages: 4502
Registered: April 1998
Senior Member
This is a FAQ - http://www.orafaq.com/faq/how_does_one_select_the_last_n_rows_from_a_table

Besides, if you bothered to do a search, you would have found plenty of similar discussions.

http://www.orafaq.com/search/last+rows
Re: Query [message #264223 is a reply to message #264214] Sun, 02 September 2007 02:51 Go to previous messageGo to next message
Arju
Messages: 1554
Registered: June 2007
Location: Dhaka,Bangladesh. Mobile:...
Senior Member

Quote:
last n rows


There is no first -last in oracle table data.
Re: Query [message #264224 is a reply to message #264214] Sun, 02 September 2007 02:54 Go to previous messageGo to next message
Arju
Messages: 1554
Registered: June 2007
Location: Dhaka,Bangladesh. Mobile:...
Senior Member

If you want to get it based on value then you
can use,

1) make order by desc
2) Then rownum<11
Re: Query [message #264225 is a reply to message #264213] Sun, 02 September 2007 02:55 Go to previous messageGo to next message
Arju
Messages: 1554
Registered: June 2007
Location: Dhaka,Bangladesh. Mobile:...
Senior Member

Avoid duplicate entry . It's already you posted in newbie.
Re: Last N rows of a table (renamed + merged) [message #264227 is a reply to message #264213] Sun, 02 September 2007 03:05 Go to previous message
Maaher
Messages: 7062
Registered: December 2001
Senior Member
Don't cross post (open the same topic in more than one forum)
Choose a more appropriate title.

More tips? Check out our OraFAQ Forum Guide

MHE
Previous Topic: bouncing db
Next Topic: how to copy tables from one user to another
Goto Forum:
  


Current Time: Thu Dec 08 03:57:21 CST 2016

Total time taken to generate the page: 0.07494 seconds