select * from
(select *,rownum as tempid from student ) t
where t.tempid between ” + pageSize*(pageNumber-1) + ” and ” + pageSize*pageNumber
mysql:
select * from students limit ” + pageSize*(pageNumber-1) + “,” + pageSize;
sql server:
select top ” + pageSize + ” * from students where id not in +
(select top ” + pageSize * (pageNumber-1) + id from students order by id) +
“order by id;