求一条Oracle的查找最后十条并分页的语句
求一条Oracle的查找最后十条数据,分页,也就是可以查找倒数1-10条,然后是倒数11-20,以此类推。
求语句,表名qiutubiao,主键是bianhao,求效率。。
------解决方案--------------------有什么问题?
你用ASC是正序排
要倒序排,应该用DESC
order by bianhao
desc------解决方案--------------------select t2.* from (
select rownum as rn,t1.* from qiutubiao t1
order by bianhao desc ) t2 where rn between 11 and 20