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();
时间: 2024-10-10 17:56:19