(1)select * from (select t.*, rownum as mark from (select * from PBD_PERSON where sex = 1 order by birthday desc) t where rownum <=40 )x where x.mark >30;
(2)select * from (select t.*, rownum as mark from (select * from PBD_PERSON where sex = 1 order by birthday desc) t )x where x.mark between 31 and 40;
(3)SELECT /*+ FIRST_ROWS */ * FROM (SELECT A.*, ROWNUM RN FROM (SELECT * FROM PBD_PERSON) A WHERE ROWNUM <= 40)WHERE RN > 30
第三条为经过优化后的SQL。