1、创建测试表,create table test_rows(id number, value varchar(200));
2、插入测试数据,
insert into test_rows
select level, ‘val_’||level from dual
connect by level
commit;
3、查询表中记录数,总共有999条,
4、编写SQL,返回最小的10条记录,
select * from (select t.*, row_number() over(order by id) rn from test_rows t ) where rn=10;