oracle分页的sql语句,分排序和不排序两种。
一、不排序
select * from(
select rownum r, field1,field2 from table_name
where rownum <= currentPage * rowPerPage
)
where r > (currentPage-1) * rowPerPage
二、排序
select * from t_xiaoxi where rowid in
(select rid from (select rownum rn,rid from
(select rowid rid,cid from t_xiaoxi order by cid desc)
where rownum<10000)
where rn>9980)
order by cid desc;
929

被折叠的 条评论
为什么被折叠?



