select * from ( select a.*, rownum rn from (select * from table_name) a where rownum<= 40 ) where rn >= 21