分页查询的两种方法(双top 双order 和 row_number() over ())
2016-03-11 13:56
267 查看
--跳过2条取2条 也叫分页
select top 2 * from student where studentno not in ( select top 2 studentno from student order by studentno ) order by studentno
--row_number ()over() 分页
select * from( select *,ROW_NUMBER() over(order by studentno)as myid from student ) as temp where myid between 4 and 6
相关文章推荐
- 解析数据库分页的两种方法对比(row_number()over()和top的对比)
- 数据库分页的两种方法对比(row_number()over() 和 top的对比)
- 数据库分页的两种方法对比(row_number()over() 和 top的对比)
- 解析数据库分页的两种方法对比(row_number()over()和top的对比)
- SQL 分页支持查询 ROW_NUMBER() OVER (ORDER BY ReportID) AS RowNo_
- SQL 分页支持查询 ROW_NUMBER() OVER (ORDER BY ReportID) AS RowNo
- SQL 分页支持查询 ROW_NUMBER() OVER (ORDER BY ReportID) AS RowNo
- SQL 分页支持查询 ROW_NUMBER() OVER (ORDER BY ReportID) AS RowNo
- 分页查询 (用row_number() 和开窗函数over()更方便)
- 用row_number() over 优化分页查询
- SQL Server2005使用ROW_NUMBER() OVER实现按分组查询Count()数量排序并分页
- SQL 分组后返回序号(ROW_NUMBER () OVER(PARTITION BY order_no ORDER BY START_Time ASC 的使用方法)
- sqlserver_分页查询_row_number() over()
- SQL优化:分页方法从top->row_number->offset的演化
- Oracle 分析函数row_number() over (partition by order by ) 的 Mysql的替代方法
- row_number() over order by与利用rownum查询分页效率分析
- mysql、MS SQL关于分页的sql查询语句 limit 和row_number() OVER函数
- sqlserver2005使用row_number() over分页的实现方法
- top分页和row_number分页方法
- SQL Server 2005 的分页查询(ROW_NUMBER() OVER 语句)