客户数据库是什么意思,SQL Server 分页 查询语句
答案:1 悬赏:30 手机版
解决时间 2021-05-16 21:56
- 提问者网友:温柔港
- 2021-05-16 16:44
客户数据库是什么意思,SQL Server 分页 查询语句
最佳答案
- 五星知识达人网友:孤老序
- 2021-05-16 17:54
sql server 2005以上的话可以用row_number()来做分页
SELECt * FROM (SELECt [id] AS '序号', [col0] AS '第一列', [col1] AS '第二列', [col2] AS '第三列', [col3] AS '第四列', [col4] AS '第五列', row_number() over (order by 排序字段) AS seqFROM [TestTable]WHERe [col4] > @limit) t WHERe seq BETWEEN (@PageIndex-1)[email protected]+1 AND @[email protected]
SELECt * FROM (SELECt [id] AS '序号', [col0] AS '第一列', [col1] AS '第二列', [col2] AS '第三列', [col3] AS '第四列', [col4] AS '第五列', row_number() over (order by 排序字段) AS seqFROM [TestTable]WHERe [col4] > @limit) t WHERe seq BETWEEN (@PageIndex-1)[email protected]+1 AND @[email protected]
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯