跳到主要内容

TO_WEEKS

Introduced or updated: v1.2.677

Converts a specified number of weeks into an Interval type.

  • Accepts positive integers, zero, and negative integers as input.

Syntax

TO_WEEKS(<weeks>)

Return Type

Interval (represented in days).

Examples

SELECT TO_WEEKS(2), TO_WEEKS(0), TO_WEEKS((- 2));

┌───────────────────────────────────────────┐
│ to_weeks(2) │ to_weeks(0) │ to_weeks(- 2)
├─────────────┼─────────────┼───────────────┤
14 days │ 00:00:00-14 days │
└───────────────────────────────────────────┘
开始使用 Databend Cloud
低成本
快速分析
多种数据源
弹性扩展
注册