数据仓库服务 GAUSSDB(DWS)-time_format:yearweek(date[, mode])

时间:2024-10-21 16:50:41

yearweek(date[, mode])

描述:返回给定日期date在本年中对应的年份和周数,周数范围为[1, 53]。

返回值类型:integer

示例:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
select yearweek('2019-12-31');
 yearweek
----------
   201952
(1 row)

select yearweek('2019-1-1');
 yearweek
----------
   201852
(1 row)
support.huaweicloud.com/sqlreference-830-dws/dws_06_0313.html
推荐文章