1) mysql select * from demowhere1=1 limit 2,3 limit是用来分页的,第一个参数是行号,第二个参数是说有多少行 2) oracle 第一种 select id, field_name,.. . from table_name where id in (select id from (select rownum as numrow, id from table_nam
1) mysql
select * from demo where 1=1 limit 2,3
limit是用来分页的,第一个参数是行号,第二个参数是说有多少行
2) oracle
第一种
select id, field_name,.. . from table_name where id in (select id from (select rownum as numrow, id from table_name where 条件1 order by 条件2) where numrow > 80 and numrow < 100) order by 条件3;
第二种
select * from (select a.* ,rownum rn from (select * from table_name) a where rownum = 21
如果支持scrollable result,使用resultset的absolute方法直接移到查询起点,如果不支持的话,使用循环语句,rs.next一点点的移过去。