Row_Number结合between查询数据
答案:1 悬赏:20 手机版
解决时间 2021-03-24 17:14
- 提问者网友:不要迷恋哥
- 2021-03-24 04:30
Row_Number结合between查询数据
最佳答案
- 五星知识达人网友:冷風如刀
- 2021-03-24 06:08
1
Select * From (
select *,ROW_NUMNER() OVER (Order By id desc) As RowRank From A
) T Where T.RowRank Between 10 AND 20
2
Create Procedure ProcQuery(
@PageIndex int
) As
Select * From (
select *,ROW_NUMNER() OVER (Order By id desc) As RowRank From A
) T Where T.RowRank Between 10*(@PageIndex-1) AND 10*@PageIndex
GO
EXEC ProcQuery 2
Select * From (
select *,ROW_NUMNER() OVER (Order By id desc) As RowRank From A
) T Where T.RowRank Between 10 AND 20
2
Create Procedure ProcQuery(
@PageIndex int
) As
Select * From (
select *,ROW_NUMNER() OVER (Order By id desc) As RowRank From A
) T Where T.RowRank Between 10*(@PageIndex-1) AND 10*@PageIndex
GO
EXEC ProcQuery 2
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯