我不明白为什么
DropdownButton<String>(
isExpanded: true,
item: dropdownItems,
//Other stuff here
)
返回“ 2016”
SELECT YEAROFWEEK('2017-01-01T00:00:00.000+00:00'::timestamp)
返回“ 52”
有人可以帮助我理解吗?
答案 0 :(得分:0)
通过更多的挖掘,我从https://docs.snowflake.net/manuals/sql-reference/parameters.html#week-of-year-policy那里得到了答案
答案 1 :(得分:0)
以下是决定其工作方式的年度政策的文档-https://docs.snowflake.net/manuals/sql-reference/parameters.html#week-of-year-policy
一个例子可能会有所帮助。在新创建的帐户上, week_of_year_policy 默认设置为0。
select YEAROFWEEK('2017-01-01T00:00:00.000+00:00'::timestamp) as yow
, WEEK('2017-01-01T00:00:00.000+00:00'::timestamp) as w;
+------+----+
| YOW | W |
+------+----+
| 2016 | 52 |
+------+----+
alter session set week_of_year_policy = 1;
select YEAROFWEEK('2017-01-01T00:00:00.000+00:00'::timestamp) as yow
, WEEK('2017-01-01T00:00:00.000+00:00'::timestamp) as w;
+------+---+
| YOW | W |
+------+---+
| 2017 | 1 |
+------+---+