sql分页 翻页的优化??
前台是extjs 后台c# 接收前台的start 和limit参数 进行分页 翻页
sql语句如下
select top " + limit + " * from View_jydhwxx where fgsbm in (" + fgsbm + ") and jhrq >= '" + jdsj1 + "' and jhrq <= '" + jdsj2 + "' and jydbh not in(select top " + start + " jydbh from View_jydhwxx where fgsbm in (" + fgsbm + ") and jhrq >= '" + jdsj1 + "' and jhrq <= '" + jdsj2 + "' order by jydbh desc) order by jydbh descselect top " + limit + " * from View_jydhwxx where fgsbm in (" + fgsbm + ") and dzzbm in ("+result+") and jhrq >= '" + jdsj1 + "' and jhrq <= '" + jdsj2 + "' and jydbh not in(select top " + start + " jydbh from View_jydhwxx where fgsbm in (" + fgsbm + ") and dzzbm in ("+result+") and jhrq >= '" + jdsj1 + "' and jhrq <= '" + jdsj2 + "' order by jydbh desc) order by jydbh descstring sql="select * from ( select row_number() over(order by name) rn,* from View_jydhwxx where fgsbm in (" + fgsbm + ") and jhrq >= '" + jdsj1 + "' and jhrq <= '" + jdsj2 + "' order by jydbh desc) t where rn between " + start + " and " + start+limit;