Home » SQL & PL/SQL » SQL & PL/SQL » Qeury on Rownum.
Qeury on Rownum. [message #234851] Thu, 03 May 2007 05:52 Go to next message
saifu
Messages: 2
Registered: May 2007
Location: India
Junior Member

Dear All,

I am new in this forum & i want some queries.
Can we do following:-

1) Display details of last record from emp table using rownum.

2) Display details of 3rd last record from emp table using rownum.

3)Display details of 7th, 8th and 9th record from emp table using rownum.

Pls help me out in wrtiting these queries.

Regards.
Re: Qeury on Rownum. [message #234853 is a reply to message #234851] Thu, 03 May 2007 05:55 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
Hi, welcome to the forum.

Please check the Newbie forum and page through it. This question was asked many many times before.
Re: Qeury on Rownum. [message #234854 is a reply to message #234851] Thu, 03 May 2007 05:56 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
1) it is a nonsense
2) select * from (select emp.*, rownum rn from emp) where rn=3;
but it is a nonsense as this row may be different each you execute the query
3) Idem

Regards
Michel
Re: Qeury on Rownum. [message #234871 is a reply to message #234854] Thu, 03 May 2007 06:45 Go to previous message
Maaher
Messages: 7062
Registered: December 2001
Senior Member
A quick search reveiled this thread.

MHE
Previous Topic: key voilation
Next Topic: UTL_FILE
Goto Forum:
  


Current Time: Sun Dec 04 00:45:57 CST 2016

Total time taken to generate the page: 0.04626 seconds