分页Sql语句(2种常用的查询sql)
2016-07-04 22:27
330 查看
【当前页为 1】
直接 select top 10 * from menus
【当前页不为1】
select top 10 * from menus where menuId >(select MAX(menuId) from (select top 30 menuId from menus order by menuId asc ) as TabTemp) order by menuId
================第二种查询方法==========================
select top 10 * from menus where menuId not in (select top 0 menuId from menus)
直接 select top 10 * from menus
【当前页不为1】
select top 10 * from menus where menuId >(select MAX(menuId) from (select top 30 menuId from menus order by menuId asc ) as TabTemp) order by menuId
================第二种查询方法==========================
select top 10 * from menus where menuId not in (select top 0 menuId from menus)
相关文章推荐
- SQL Server 数据库远程访问
- 通过Navicat for MySQL远程连接的时候报错mysql 1130的解决方法
- sql tempdb temptable
- MySQL 单表百万数据记录分页性能优化
- Redis和Memcached区别
- Ubuntu下如何安装与运行Redis
- 键值存储之redis
- 01-CoreData简介
- 安卓中数据库增删改查的方法
- 数据库自增主键可能产生的问题
- win 10 mysql 5.6.31下载安装教程
- sql case when
- Redis和Memcached的区别
- plsql远程连接服务器oracle数据提示字符集错误的解决方法
- hadoop学习之HIVE(3):hadoop2.7.2下安装hive2.1.0并关联mysql数据库
- 数据库集群技术
- mongoDB- - 2 增、删、改 操作
- MySQL 触发器简单实例
- Oracle入门学习(6)
- 源码编译mysql报错解决