Reputation: 2256
I had run following query in Oracle Database and produces following output:
Query: select id,name from member where name like 'A%';
ID Name
261 A....
706 Aaa.......
327 Ab.....
and more...
This Query returns 50 records and
I want to display 10 records at a time to user.
Since, ID does not contain data in autoincrement fashion, i cannot use between operator.
and rownum operator also doesn't help much.
Kindly Help.
Regards,
Ankit Agarwal
Upvotes: 1
Views: 202
Reputation: 25390
SELECT ID, Name
from (
select id,name, ROW_NUMBER() over( order by name) r
from member
where name like 'A%'
)
WHERE R between FromRowNum AND ToRowNum;
Upvotes: 1
Reputation: 14902
See http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:76812348057
Upvotes: 1