select using rownum [message #273990] |
Fri, 12 October 2007 10:53 |
aparna_ora
Messages: 14 Registered: September 2005
|
Junior Member |
|
|
hi all
I want to select data from emp table.. I want to retrieve data in range but i dont know the empid's ..
I want to retrieve data from somewhere 100 to 999 but I dont know the empid's .. Using rownum how can i query this?
appu
|
|
|
|
|
|
|
|
Re: select using rownum [message #274881 is a reply to message #274789] |
Wed, 17 October 2007 10:09 |
aparna_ora
Messages: 14 Registered: September 2005
|
Junior Member |
|
|
I doont think Order by will work. I want range of rownum.
means in between kind of records whose empid i dont know.
I want to retrive records starting from 100 to 999 etc using rownum..
plz can any one suggest me query?
appu
|
|
|
Re: select using rownum [message #274882 is a reply to message #274084] |
Wed, 17 October 2007 10:14 |
aparna_ora
Messages: 14 Registered: September 2005
|
Junior Member |
|
|
hi
I used select ename,jobid from emp
where rownum between (100 and 999) kind of query
but with rownum between clause never worked out.
i dont know how to select range of rownum...
|
|
|
|
Re: select using rownum [message #274913 is a reply to message #274882] |
Wed, 17 October 2007 12:14 |
joy_division
Messages: 4963 Registered: February 2005 Location: East Coast USA
|
Senior Member |
|
|
aparna_ora wrote on Wed, 17 October 2007 11:14 | hi
I used select ename,jobid from emp
where rownum between (100 and 999) kind of query
but with rownum between clause never worked out.
i dont know how to select range of rownum...
|
This is the equivalent of just
select ename,jobid from emp where rownum <= 900;
999 - 100 + 1 = 900
What do you think the difference between row number 1 and row number 100 is? If you can define that, then Frank's Top-N query can be applied.
|
|
|