SQL Server查询 返回了ROW_NUMBER 列, 导致子查询错误

浏览:292 发布日期:2019/05/04
5.0.0 - 严重 - 未处理
SQL Server数据库查询 返回了ROW_NUMBER 列, 导致子查询错误
如以下SQL

SELECT
T1.*
FROM
(
SELECT
thinkphp.*, ROW_NUMBER () OVER (ORDER BY rand()) AS ROW_NUMBER
FROM
(
SELECT
ComCompanyName AS CompanyName,
ComLegalPerson AS LegalPerson
FROM
[CaseReceiveUser]
WHERE
[ID] IN (
SELECT
T1.*
FROM
(
SELECT
thinkphp.*, ROW_NUMBER () OVER (ORDER BY rand()) AS ROW_NUMBER
FROM
(
SELECT
MAX (ID) AS ID
FROM
[CaseReceiveUser]
GROUP BY
[ComCompanyName]
) AS thinkphp
) AS T1
)
) AS thinkphp
) AS T1
WHERE
(
T1.ROW_NUMBER BETWEEN 0 + 1
AND 0 + 10
)
评论(
后面还有条评论,点击查看>>