我正在尝试创建一个查询,该查询将计算多个指标MTD。因此,如果我想计算12月12日的收入,那么它将把12月1日到12月12日之间的所有天数相加。我一直在尝试使用窗口函数来实现这一点。)as float)))/ (partition by ms.market order by ms.date))as float) as "MTD_rev_growthtrunc(DATE_TRUNC('day'
需要显示2019年6月13日至2019年6月27日期间每个日期的总销售额,以及每个日期的MTD销售(2019年6月1日-当前日期)。partition by datepart(month, date) order by date ROWS between unbounded preceding and current row) as 'MTDSales' where date between '13/06/2019' and '27/06/2