sqlserver 开窗函数分页
2015-09-24 09:25
344 查看
if exists(select * from sysobjects where name='usp_getPageData') drop proc usp_getPageData go create procedure usp_getPageData @totalPage int output,--总页数 @pageIndex int =1 ,--当前页码,默认是第一页 @pageCount int =5 --每一页显示的记录数 as select * from (select ROW_NUMBER() over(order by studentno) id,* from Student) temp where temp.id>(@pageindex-1)*@pagecount and temp.id<=(@pageindex*@pagecount) set @totalPage=CEILING((select COUNT(*) from Student)*1.0/@pageCount) go
相关文章推荐
- MSSQL执行分页查询
- 7年来第1次,发现的sql绕过登录的问题
- WebApi多数据库切换
- 总结sql语句
- 报错:1130-host ... is not allowed to connect to this MySql server 开放mysql远程连接 不使用localhost
- Python操作Redis之key的查看与删除
- Nagios客户端执行oracle检查脚本和远程server端不一致的问题
- 学习笔记:nodejs(二)——node+express+mongodb建站相关(express4)
- SQLSERVER和ORACLE批量处理表名和字段名大写
- oracle数据库连接无响应的解决
- mysql数据文件迁移到新的硬盘分区的方法
- 不知道数据库中表的列类型的前提下,使用JDBC正确的取出数据(转)
- mysql 查询语句优化实例
- Oracle11g 出现 account is unlocked 问题的解决
- mysql数据库user表host字段的%问题
- 提问:恢复Mysql的备份文件失败
- nodejs使用MySQL
- mysql修改表、字段、库的字符集
- MongoDB的常规备份策略
- Hibernate 使用原生 Native SQL