我有以下查询正在生成错误消息
消息 209,级别 16,状态 1,第 4 行不明确的列名称“p_id”
以下是有问题的查询。
SELECT *
from (select playerperform.p_id,player.first_name, SUM (playerperform.score)as totalgoal, RANK() OVER(ORDER BY SUM(playerperform.score)DESC) Rnk
from playerperform,player
Group by p_id
)as a
WHERE Rnk = 1