Guifang

导航

ORACLE查询第N到M条数据

句式1:

SELECT * FROM (SELECT tb.*,rownum RN FROM
(查询sql语句)
tb where rownum<=M) where rn>N

句式2:

select * from (
select tb.*, row_number() over(order by  列名 desc)
rownumber from
(

查询sql语句

) tb [where条件]
) where rownumber between N and M;

 

posted on 2012-11-05 17:33  Guifang  阅读(265)  评论(0编辑  收藏  举报