跳到主要内容

TO_DAY_OF_WEEK

Converts a date or date with time (timestamp/datetime) to a UInt8 number containing the number of the day of the week (Monday is 1, and Sunday is 7).

Syntax

TO_DAY_OF_WEEK(<expr>)

Arguments

ArgumentsDescription
<expr>date/timestamp

Return Type

TINYINT

Examples


SELECT
to_day_of_week('2023-11-12 09:38:18.165575');

┌──────────────────────────────────────────────┐
│ to_day_of_week('2023-11-12 09:38:18.165575')
├──────────────────────────────────────────────┤
7
└──────────────────────────────────────────────┘
开始使用 Databend Cloud
低成本
快速分析
多种数据源
弹性扩展
注册