Hi,
In my application, I have to display 20 rows at a time when I click on a button(Using SERVLET).
what is the query for retreiving data between 21 to 40 records and so on...!
badrinath
Try that
select rownum,mem_id from member_tbl group by rownum,mem_id
having rownum between 21 and 40;
Best wishes!
Dmitri
for example,if you want to have records from 10 to 20
do
select * from emp where rownum < 21
minus
select * from emp where rownum < 11;
Dragon
KGB,
This sql is a better one and works effectively
Badrinath
Search for 'Window ROWNUM' on this forum and follow all the threads on this topic.
Here is one of them:
http://www.dbasupport.com/forums/sho...?threadid=5480
Here is the example from the threads:
SELECT
---OUTER.C1
FROM
---(
------SELECT
---------INNER.C1,
---------ROWNUM
------------AS QUERY_ROWNUM
------FROM
---------(
---------SELECT
------------C1
---------FROM
------------TABLE1
---------ORDER BY
------------C1
---------) INNER
------WHERE
---------ROWNUM (LESS THAN) 8
---) OUTER
WHERE
---OUTER.QUERY_ROWNUM >= 4
This is the best way to implement 'windowing' through a result set. The minus implementation is not optimal and kgb's example will not work if you need to do an ORDER BY, which is almost always a requirement of windowing.
HTH,
- Chris
Hey chrisrlong ,
When you are composing your messages, type < to get the < character. Keeps you from having to type (LESS THAN) in your examples.
I know that has been bugging you for a while. :)
HTH,
Heath
haha
<<<<<<<<<<<<
Cool!
Thanks,
- Chris
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Click Here to Expand Forum to Full Width
Bookmarks