oracle 几种分页

//1。---oracle下带排序的分页-------0.32秒完成(pl/sql下测试)
//select * from 
//(select row_number() over(order by AAC001) rn,t.* from SS_IDL_COLLATE t ) 
//where rn <50 and rn>=10

//2。---oracle下效率较高的分页-----0.27秒完成
//select * from 
//(select rownum rn,t.* from SS_IDL_COLLATE t where rownum<50) 
//where rn>=10 

//3。---minus差分页,感觉此方法效率不稳定,一般比第2种方法快---0.21秒
//select * from SS_JC10 where rownum<50 minus select * from SS_IDL_COLLATE where rownum<=10 

sbSql.append("select * from ") 
.append("( ")
.append("select rownum rn, t.* from ") 
.append("( ")
.append("select * from t_user where user_id <> 'root' order by user_id ")
.append(") t where rownum <=? ")
.append(") where rn>? ");

posted @ 2013-09-01 16:30  City_Hunter_XYZ  阅读(469)  评论(0)    收藏  举报