-1
select max(a.totalgoal)as 'MAXIMUM goles',p_id
from 
(select playerperform.p_id, SUM (playerperform.score)as totalgoal from playerperform  
Group by p_id)as a
4

1 回答 1

1

在 SQL Server 中,您可以为此使用该RANK()函数:

SELECT *
from (select playerperform.p_id, SUM (playerperform.score)as totalgoal, RANK() OVER(ORDER BY SUM(playerperform.score)DESC) Rnk
      from playerperform  
      Group by p_id
      )as a
WHERE Rnk = 1
于 2013-10-24T19:46:10.187 回答