您现在的位置是:网站首页> 编程资料编程资料
二种sql分页查询语句分享_MsSql_
2023-05-26
346人已围观
简介 二种sql分页查询语句分享_MsSql_
根据题意理解:
本质就是写分页查询:
每页条数:10条;
当前页码:4页;
复制代码 代码如下:
//第一种:
select * from
(select ROW_NUMBER() over(order by Id asc) as num,* from UserInfo)as u
where u.num
between
10*(4-1)+1
and
10*4
//第二种:
select top 10 * from UserInfo
where Id not in
(select top (10*3) id from UserInfo order by Id)
order by Id
您可能感兴趣的文章:
相关内容
- bak文件怎么打开 2000w数据怎么打开?_MsSql_
- MSSQL附加数据库拒绝访问提示5120错误的处理方法_MsSql_
- SQL-ORDER BY 多字段排序(升序、降序)_MsSql_
- sql 取代游标的写法示例_MsSql_
- sqlserver、mysql获取连接字符串步骤_MsSql_
- SqlServer修改数据库文件及日志文件存放位置_MsSql_
- SQL Server降权运行 SQL Server 2000以GUESTS权限运行设置方法_MsSql_
- SQL Server 分页查询通用存储过程(只做分页查询用)_MsSql_
- sqlserver清除完全重复的数据只保留重复数据中的第一条_MsSql_
- sqlserver登陆后报不能为空不能为null的错误_MsSql_