- 使用
rownumber() over()
函数产生序列,再where条件限定条数。
select * from (select rownumber() over() as tbid, a.* from SAPHEC.ZBMT301 a) as b where b.tbid<=10;
- 查询第10条至第15条的数据
select * from (select rownumber() over() as tbid, a.* from SAPHEC.ZBMT301 a) as b where b.tbid between 10 and 15;
-
fetch first 10 rows onl
取10条数据
SELECT * FROM SAPHEC.ZBMT301 fetch first 10 rows only;