The SQL statement is: String SQL = "select * from (select rownum rn, p. * from (select * from page) p where rownum <= '"+ end_page +"') where rn> '"+ start_page + "'"; Example: select * From ( Select rownum rn, p .* From (Select * From page order by id ) P where rownum <= 4 ) Where rn> 3; // use a pseudo Column !! Finally, I attached the SQL code: Create table page ( Id varchar2 (6) not null, Username varchar2 (20) not null, Password varchar2 (20) not null, Info varchar2 (200) default 'Hello, everyone! ', Constraints pk_id primary key (id) ); Select * from page; Delete page; Drop table page; Insert into page (id, username, password) values ('20140901', 'huangke', '20160901 '); Insert into page (id, username, password, info) values ('000000', 'shaow', '000000', 'I'm JJ, Lin Junjie! '); Insert into page (id, username, password) values ('2013', 'shen Junjie ', 'qqqqqq '); Insert into page (id, username, password, info) values ('000000', 'yang Xiaoyu ', '000000', 'My shift leader! '); Insert into page (id, username, password) values ('2013', 'xu shiqun ', 'xxxxxx '); Insert into page (id, username, password, info) values ('000000', 'wang dongbao', '000000', 'Grandpa! '); Insert into page (id, username, password, info) values ('201312', 'admin', 'admin', 'My Postmaster! '); Insert into page (id, username, password, info) values ('123456', 'Liu peng', '123456', 'I love games! '); Insert into page (id, username, password, info) values ('000000', 'Liu yongjun ', 'liu666',' I am a little late haha! '); Update page set info = 'I'm a young man, haha !! 'Where id = '2013 '; Select rownum, p. * from page p where rownum between 1 and 4; Select count (id) as a from page; Select count (id) as count_row from page; Select * From ( Select rownum rn, p .* From (Select * From page order by id ) P where rownum <= 4 ) Where rn> 3; Select * From ( Select rownum rn, p .* From (Select * From page) p where rownum <= 6 ) Where rn> 3 |