oracle分页查询sql语句
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了oracle分页查询sql语句相关的知识,希望对你有一定的参考价值。
String sql="select * from( select e.*,rownum r from( select * from emp order by sal desc )e ) where r between ? and ? ";
String sql="select * from( select e.*,rownum r from( select * from emp order by sal desc )e ) where r between 6 and 10 ";
StringBuilder vs = new StringBuilder();
vs.append("select * from (");
vs.append("select e.*, rownum RNO from (select * from emp order by sal desc) e ");
vs.append(")");
vs.append("where RNO between ? and ? "); //动态的SQL语句。
String sql = vs.toString();
以上是关于oracle分页查询sql语句的主要内容,如果未能解决你的问题,请参考以下文章