熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> Oracle >> 正文

Oracle的翻頁Sql語句

2013-11-13 15:42:45  來源: Oracle 

  StringBuffer pagingSelect = newStringBuffer();

        pagingSelectappend(select * from ( select row_* rownum rownum_ from ( );
        pagingSelectappend(sql);
        pagingSelectappend( ) row_ where rownum <= + endRow + ) where rownum_ > + startRow);

startRow 是記錄開始處
endRow 是記錄結束處

舉例來說
從第條到第

select * from (

  select row_* rownum rownum_from (
      
            select person_id chn_name chn_firstname_py from t_pbase_info
          
        ) row_ where rownum <=
      
    ) where rownum_ >=


From:http://tw.wingwit.com/Article/program/Oracle/201311/17173.html
    推薦文章
    Copyright © 2005-2013 電腦知識網 Computer Knowledge   All rights reserved.