Oracle分页(limit方式的运用)

select * from a_matrix_navigation_map
where rowid not in(select rowid from a_matrix_navigation_map where rownum<=0) and rownum<=10

第二种:

SELECT * FROM
(
SELECT A.*, rownum r
FROM
(
SELECT *
FROM a_matrix_navigation_map

) A
WHERE rownum <= 10
) B
WHERE r > 0

第三种

SELECT * FROM table WHERE ROWNUM<101;
minus
SELECT * FROM table WHERE ROWNUM<91;
第四种

可以用变通一点的办法,我给个示例:

sql = "select a_id,a_title,a_author,aID,a_time,a_readtime,sID from article order by a_id";

int a;
while (rs.next()) {
a++;
if (a=ipage+spage)continue;
...
}
 

其中第二种是非常成熟的分页
我的实例~ 即可实现 类似limit 功能
 
  $bandanspager="select * from abc t2,abc1 t1 where t1.id=t2.id group by t1.id";
 
  $sql=" SELECT * FROM
         (
            SELECT A.*, rownum r
            FROM
            ( ".$bandanspager.") A
            WHERE rownum <= 10
         ) B
         WHERE r > 0

你可能感兴趣的:(oracle,职场,休闲,oracle分页,limit方式)