SELECT CUST_ID,CONTACTS
Sum("CONTACTS") Over (PARTITION by "CUST_ID" Order By "end_Period" ROWS UNBOUNDED PRECEDING) as RunningContacts,
"SALES",
Sum("SALES") Over (PARTITION by "CUST_ID" Order By "end_Period" ROWS UNBOUNDED PRECEDING) as RunningSales,
end_Period
FROM Table2
我目前已经在excel公式中创建了“跑步增长”列,该栏是(新跑步销售-之前跑步销售)/以前跑步销售。
感谢您的帮助。
答案 0 :(得分:0)
SQL派生表可以保存一个查询,以按期间汇总销售额,您可以对其进行联接以将每个期间与上一个期间进行比较。
答案 1 :(得分:0)
您在寻找这个吗?
select t.*,
RunningSales / (Running - Sales) - 1
from (< your query here > ) x