Home » RDBMS Server » Server Administration » retriving particular rows in order
retriving particular rows in order [message #372730] Tue, 06 March 2001 09:23 Go to next message
Siddharth Bahri
Messages: 18
Registered: March 2001
Junior Member
Hi,

I am opening a cursor in an oracle package
with a statement similar to the one given below.

The cursor returns rows 10 to 20 from the selected
rows sorted in a particular field

OPEN CURSOR_VAR FOR
select fieldname from
TableName
 where ROWNUM<=20
MINUS
Select fieldname from
TableName
where ROWNUM<=10
ORDER BY fieldname desc;

My problem is that oracle first retrives the
10 rows and then sorts them which does'nt give the
proper rows.
I want it to sort all the rows first and then retrive
the rows 10 to 20

Any suggestions???
Re: retriving particular rows in order - URL [message #372736 is a reply to message #372730] Tue, 06 March 2001 10:20 Go to previous message
Andrew again...
Messages: 270
Registered: July 2000
Senior Member
See the following link regarding returning a "paged" set of results...
http://www.jlcomp.demon.co.uk/plsql_a.html
Previous Topic: Re: Command to drop all tables???
Next Topic: Re: who to search patterns ([0-9] or [a-z]) in sql
Goto Forum:
  


Current Time: Mon Jun 10 22:12:22 CDT 2024