思路给表添加一个索引列,查询索引列从第1行到第30行,就是页面为30条,第一页的查询
ROW_NUMBER() OVER(order by id desc) AS n
select * from(
select ROW_NUMBER() OVER(order by id desc) AS n ,
* from dbo.CRM_Follow
) as t_follow
where
n BETWEEN 1 AND 30
思路给表添加一个索引列,查询索引列从第1行到第30行,就是页面为30条,第一页的查询
ROW_NUMBER() OVER(order by id desc) AS n
select * from(
select ROW_NUMBER() OVER(order by id desc) AS n ,
* from dbo.CRM_Follow
) as t_follow
where
n BETWEEN 1 AND 30