oracle 分页

记录一下,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

下面是 一条通用的分页代码
String sql = "select rownum as row_num,t__.* from (" + innerSql
+ ") t__";
sql = "select X_.* from(" + sql + ") X_ where "
+ "X_.row_num>=? and X_.row_num < ? ";

你可能感兴趣的:(oracle 分页 sql)