Oracle分页


根据开始位置和结束位置分
select * from

(select a.*,rownum row_num from

(select * from mytable t order by t.id desc) a

) b where b.row_num between 1 and 10

根据当前页和每页最大数分
SELECT TWO.* FROM
		(SELECT ROWNUM RN, ONE.* FROM (
		SELECT * FROM empl
		) ONE) TWO
		WHERE 1 = 1
		AND TWO.RN > 10 * (2 - 1)
		AND TWO.RN < 10 * 2 + 1


你可能感兴趣的:(oracle)