首页 > 解决方案 > 总和 >90 天除以总天数

问题描述

第一次发帖,希望一切顺利。我试图总结一些价值观。我试过以下代码。

select t1.ar_date_string,
       t1.sum(amount) / (select sum(t1.aMOUNT) 
--from V_CUBE_F_PB_TRANSACTION_AGE pba1 where AR_DATE_RANGE='Current AR' )
from t1
where t1.AR range='historical AR' and t1.days out>90
group by t1.ar_date_string, t1.payor


payor   ar date string  AR range    days out    amount
walm    9/13/2021       current           80    $100.00 
lowes   8/31/2021     historical         100    $100.00 
jcp     8/31/2021      historical       120      $50.00 
belk    8/31/2021       historical       50     $80.00

我对延迟表示歉意,因为图像等有问​​题。希望每个付款人每行的百分比。再次感谢大家,

在此处输入图像描述

标签: sqlsummarize

解决方案


推荐阅读