码迷,mamicode.com
首页 > 数据库 > 详细

oracle分页查询sql语句

时间:2016-10-01 19:10:42      阅读:253      评论:0      收藏:0      [点我收藏+]

标签:

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语句

标签:

原文地址:http://www.cnblogs.com/zhaoqingwin/p/5926036.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!