跳到主要内容

YEARWEEK

Returns the year and week number in YYYYWW format, according to ISO week date. Week 1 is the week with the first Thursday of the year.

Syntax

YEARWEEK(<date_or_timestamp>)

Return Type

UInt32.

Examples

SELECT
YEARWEEK('2024-01-01') AS yw1,
YEARWEEK('2024-12-31') AS yw2;
┌─────────────────┐
│ yw1 │ yw2 │
├────────┼────────┤
202401202501
└─────────────────┘
开始使用 Databend Cloud
低成本
快速分析
多种数据源
弹性扩展
注册