Ankit
Ankit

Reputation: 2256

Display Records through SQL in Oracle

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

Answers (2)

Michael Pakhantsov
Michael Pakhantsov

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

Related Questions