分析函数 oracle 使用 rownum select * from (select t.* , row_number() over(ORDER BY rownum) num from table t) s where s.num between ? and ?;sqlserver 使用 @@rowcount select * from (select t.* , row_number() over(ORDER BY @@rowcount) num from table t) s where s.num between ? and ?;MySQL 使用limit select t.* from table t where子句+ limit ?,?;---------------------------------以上是语句级别,各种数据的做法各异。更彻底的做法是在JDBC的驱动层做手脚。利用ResultSet的方法absolute来做读取数据的定位。
可以先查询 前面十条 在点下一页的时候 就传个参数 就查询 除前十条外的 十条 第三页的时候 就查询 除 前二十条的 十条 就这样 依次 就可以了
oracle 使用 rownum
select * from (select t.* , row_number() over(ORDER BY rownum) num from table t) s where s.num between ? and ?;sqlserver 使用 @@rowcount
select * from (select t.* , row_number() over(ORDER BY @@rowcount) num from table t) s where s.num between ? and ?;MySQL 使用limit
select t.* from table t where子句+ limit ?,?;---------------------------------以上是语句级别,各种数据的做法各异。更彻底的做法是在JDBC的驱动层做手脚。利用ResultSet的方法absolute来做读取数据的定位。