----使用CTE分页
----TableOrderByColumns:要查询的列
----TableName:表名
----TableQuery:查询条件
----beginindex:开始记录
----endindex:结束记录
with t_pager as (
select myIndex = ROW_NUMBER() OVER (ORDER BY TableOrderByColumns ),* from TableName where TableQuery
)
select TableShowColumns from t_pager where myIndex between beginindex and endindex