oracle分页查询

SELECT b.* FROM (   
SELECT ROWNUM r,a.* FROM (   
SELECT * FROM cms_content t where t.subject2 is not null ORDER BY id DESC) a ) b   
WHERE b.r>=5 AND b.r<=10  


select a.id,a.url,a.title,a.rownum1 from (select s.id, s.url, s.title,rownum as rownum1 from (select id, url, title from cms_content t 
where t.subject2 is not null order by t.id desc) s where rownum<=10) a where a.rownum1 >=5

 

你可能感兴趣的:(oracle,cms)