String sql = "SELECT TOP "+form.getPageSize()+" tb.* from( "
+ "select ROW_NUMBER() OVER ( order by id desc) AS RowNumber, id,name from t_role " + " ) tb WHERE RowNumber > "+((form.getPageindex() - 1) * form.getPageSize());上面的这种分页比select top 10 id from student where id not in (select top 5 id from student)
如果加条件的话下面需要双份,上面只需要一份条件。上面的分页条件比较好。