此查询在我的部落php排名脚本中正确显示。
SELECT TOP 100
IDNum,
IDName,
Nation,
(SELECT SUM(LoyaltyPoint)
FROM USERDATA
WHERE USERDATA.Knights = KNIGHTS.IDNum
AND USERDATA.Authority IN(1, 2)) as ClanLoyalty
FROM KNIGHTS
ORDER BY ClanLoyalty DESC
但我想在LoyaltyPoint
的{{1}}第二条规则之上添加。
MannerPoint
但这不起作用,也不显示。
我使用MSSQL 2005
答案 0 :(得分:1)
这里有一个额外的括号;
AND USERDATA.Authority IN(1, 2)) ) as MannerPoint
删除了额外括号的调整后代码:
AND USERDATA.Authority IN(1, 2) ) as MannerPoint