–sql server 分页查询的方法(查询每页5行,第五列的数据)
–1.方法1
select top 5*from Org where id not in(select top (5*(5-1)) Id from Org order by Id asc) order by Id asc
–2.方法2
–分页 row_numver()生成数字,over()根据表里的id字段排序生成逻辑顺序(每页5行,查询第五列的数据)
select *from(select *,rn=ROW_NUMBER()over(order by id asc)from Org )as t where t.rn between(5-1)*5+1 and 5*5