Perc per football cluff 的总分

Perc per football cluf of the total points

我想计算每个俱乐部的总积分百分比。下面是我的代码还不能用。因为我还没有得到结果。在图片中,您可以看到所述的数据结构。还查看了 Whosebug 上的其他解决方案,但没有找到想要的结果。

select f.ClubName, count(u.p) * 100.0 / sum(count(u.p)) over()
From fact f
join uitslag u
on u.StandID = f.StandID

我认为您需要 group by clubnamesum() 而不是 count()

select f.ClubName, 
  sum(u.p) * 100.0 / sum(sum(u.p)) over()
From fact f
join uitslag u
on u.StandID = f.StandID
group by f.clubname 

查看 simplified 演示。