--建表
create table dinya_test
()
--插入数据
insert into dinya_test values(1, 12, 'BOOKS',sysdate);
insert into dinya_test values(2, 12, 'BOOKS',sysdate+30);
insert into dinya_test values(3, 12, 'BOOKS',to_date('2005-05-30','yyyy-mm-dd'));
insert into dinya_test values(4, 12, 'BOOKS',to_date('2007-06-23','yyyy-mm-dd'));
insert into dinya_test values(5, 12, 'BOOKS',to_date('2011-02-26','yyyy-mm-dd'));
insert into dinya_test values(6, 12, 'BOOKS',to_date('2011-04-30','yyyy-mm-dd'));
commit;
分页查询
select * from (
select row_number() over(order by transaction_id desc) rn, test.*
from dinya_test test
)where rn between 1 and 3