拿 某张表里面的第N行到第M行的数据。查了很多地方,很多人开始以为ResultSet里面的setFetchSize()可以做到,可惜据我测试,行不 通。
DB2里面的方法:
SELECT *
FROM (SELECT
ROW_NUMBER() OVER (ORDER BY empno ASC) AS rownumber,
empno, firstnme
FROM edwarde.employee
) AS foo
WHERE rownumber between 3 and 5;
DB2里面的方法:
SELECT *
FROM (SELECT
ROW_NUMBER() OVER (ORDER BY empno ASC) AS rownumber,
empno, firstnme
FROM edwarde.employee
) AS foo
WHERE rownumber between 3 and 5;