您好,我需要帮助分析以下数据。我需要的逻辑是每个提供程序的总和应除以其余提供程序。例如,根据以下数据,每个总和(提供者)应由总和(提供者的其余部分)剥离
sum(east RISK)/sum(west Risk)+sum(south RISK)
sum(west RISK)/sum(east RISK)+sum(south RISK)
sum(south RISK)/sum(east RISK)+sum(west RISK)
and so on....
....
....
Mbr Provider Group Risk
1 east Group 2.44
2 east Group 0.05
3 east Group 1.01
4 east Group 0.14
5 west Comp MRKT 0.32
6 west Comp MRKT 2.12
7 south Comp MRKT 5.78
8 south Comp MRKT 1.11
答案 0 :(得分:0)
我认为您可以为此使用ANSI标准窗口功能:
select provider,
(sum(risk) / (sum(sum(risk)) over () - sum(risk))
)
from t
group by provider;