- 使用
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;