Oracle分页语句

 

  page size :3

  page number: 2

  需要考虑order by 的情况:


  select s.* from
  ( 
     select rownum as rn,c.*
     from (select * from tableName order by columnName desc) c
  ) s
  where s.rn between 3*(2-1)+1 and 2*3;

  
   select * from
   (
      select rownum as rn,c.*
      from (select * from tableName order by columnName asc) c
      where rownum<2*3+1
   ) s
   where s.rn>3*(2-1);

 

 

 

你可能感兴趣的:(oracle,C++,c,C#)