一,MySQL

   基本句式

    select * from tableName where  ...  order by ... limit [n,]m;

    就是查询从第n条数据后的m 条数据。n可由可无。

   子查询的分页方式,提高查询速度

    select * from tableName where id>=

    (select id from tableName where ...orderby... limit n,1) limit m;

 


二, oracle 

   基本句式

    select * from tablename from(select ROWNUM r,t1.* from tablename t1 where

    ROWNUM<=n+m) t2 where t2.r>n;

    select * from (select a.*,ROWNUM r from(select * from tablename)a where ROWNUM<=n+m)

    where a.r>n

 posted on 2017-02-17 16:12  夏末秋萍  阅读(110)  评论(0编辑  收藏  举报