如题,看看这个语句分页要怎么写
SELECT TOP 10 A.User_Code,A.User_Sex,C.PropertyInstance_Value,A.PhoneNo FROM Base_UserInfo A, Base_UserRole B,
Base_AppendPropertyInstance C
WHERE A.User_ID=B.User_ID AND
B.User_ID=C.PropertyInstance_Key AND
C.Property_Control_ID='ChatName'
3 回答
aluckdog
TA贡献1847条经验 获得超7个赞
DECLARE @pageSize INT =10, @pageIndex INT=1
SELECT * FROM (
SELECT
ROW_NUMBER() OVER(ORDER BY User_ID) AS rowNum,
A.User_Code,
A.User_Sex,
C.PropertyInstance_Value,
A.PhoneNo
FROM Base_UserInfo A,Base_UserRole B,Base_AppendPropertyInstance C
WHERE
A.User_ID=B.User_ID
AND B.User_ID=C.PropertyInstance_Key
AND C.Property_Control_ID='ChatName'
) AS tb
WHERE tb.rowNum BETWEEN @pageIndex-1 * @pageSize AND @pageIndex * @pageSize
- 3 回答
- 0 关注
- 581 浏览
添加回答
举报
0/150
提交
取消