当前位置:Gxlcms > 数据库问题 > SQL分页语句

SQL分页语句

时间:2021-07-01 10:21:17 帮助过:2人阅读

--2.思路:--每页5条数据,要看第3页的数据
--1>先为每条记录增加一个行号。row_number()
--2>通过用户要查看的数据,使用行号进行筛选。
--3每页5条,要看第3也,因该是从第(2*5)+1 ... 3*5
select * from
(select *,rn=row_number() over(order by FormContentTime asc) from _UserForm) as t
where t.rn between (2*5)+1 and 3*5

SQL分页语句

标签:

人气教程排行