mysql 与 Oracle 分页

mysql:
起始索引
startIndex = (page-1)*pageSize;
每页记录数

maxCount = pageSize;

select * from emp limit startIndex,maxCount

oracle:

起始行号
startRownum = (page-1)pageSize+1;
结束行号
endRownum = page
pageSize;

SELECT * FROM (SELECT ROWNUM r,t.* FROM emp t WHERE ROWNUM<=endRownum) WHERE r>=startRownum;

你可能感兴趣的:(mysql 与 Oracle 分页)