分页查询==>
方法1:
(ROW_NUMBER()函数)语句形式:
select * from (
select *,ROW_NUMBER() OVER (ORDER BY column_name) as rank from
table_name
) as t where t.rank between 3000001 and 3000010
方法2
(利用IN)语句形式:
select top 10 * from tbl_name where FlightsDetailID in(
select top 10 FlightsDetailID from(
select top 3000010
FlightsDetailID from tbl_name order by FlightsDetailID
) as t order by
t.FlightsDetailID desc
) order by FlightsDetailID
方法3 (利用Not
In)语句形式:
select top 10* from tbl_FlightsDetail where FlightsDetailID not in
(
select top 3000000 FlightsDetailID from tbl_FlightsDetail order by
FlightsDetailID
) order by FlightsDetailID
方法4 定位法
(利用ID大于多少)语句形式:
select top 10 * from tbl_FlightsDetail where
FlightsDetailID>(
select max(FlightsDetailID) from (
select top 3000000 FlightsDetailID from tbl_FlightsDetail order by
FlightsDetailID
) as t
) order by FlightsDetailID
相关文章
- 11-01SqlServer存储过程输出参数
- 11-01分页器案例 (百度招聘)
- 11-01sqlserver字符串查找函数charindex
- 11-01SQLserver行转列与列转行
- 11-01关于ireport分页的使用
- 11-01使用rest_fromwork分页
- 11-01分页和排序
- 11-01海量数据的分页怎么破
- 11-01【Django REST framework】DRF快速编写接口(查询所有数据、分页、搜索、过滤、排序、新增单条数据)
- 11-01sqlserver 存储过程 带输出参数