Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jsp/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Snowflake cloud data platform 窗口函数与日期时间的组合 窗口函数与日期时间的组合:_Snowflake Cloud Data Platform - Fatal编程技术网

Snowflake cloud data platform 窗口函数与日期时间的组合 窗口函数与日期时间的组合:

Snowflake cloud data platform 窗口函数与日期时间的组合 窗口函数与日期时间的组合:,snowflake-cloud-data-platform,Snowflake Cloud Data Platform,《雪花》里有这样的东西吗 select t.*, sum(qty) over (partition by article order by date range between interval '27 day' preceding and current row ) as sum_qty_28_days from t; 摘自: 在snowflake中

《雪花》里有这样的东西吗

select t.*,
       sum(qty) over (partition by article
                      order by date
                      range between interval '27 day' preceding and current row
                     ) as sum_qty_28_days
from t;
摘自:


在snowflake中,可以使用以下查询

select t.*,
       sum(qty) over (partition by article
                      order by date
                      rows between 27 preceding and current row
                     ) as sum_qty_28_days
from t;

在snowflake中,可以使用以下查询

select t.*,
       sum(qty) over (partition by article
                      order by date
                      rows between 27 preceding and current row
                     ) as sum_qty_28_days
from t;
从雪花的

对于滑动窗框:

行是包含的,并且始终相对于当前行

范围不受支持

您最好的选择是在您共享的链接中使用的相关子查询方法。

来自Snowflake's

对于滑动窗框:

行是包含的,并且始终相对于当前行

范围不受支持


您最好的选择是在您共享的链接中使用相关子查询方法。

绝对正确。但是如果一天过去了,这可能不是最合适的解决办法。但如果一天过去了,这可能不是最合适的解决方案。