コンテンツにスキップ

日付または日時(タイムスタンプ/datetime)を、曜日の番号(月曜日が 1、日曜日が 7)を表す UInt8 の数値に変換します。

func.to_day_of_week(<expr>)
func.to_day_of_week('2023-11-12 09:38:18.165575')
┌────────────────────────────────────────────────────┐
│ func.to_day_of_week('2023-11-12 09:38:18.165575') │
│ UInt8 │
├────────────────────────────────────────────────────┤
│ 7 │
└────────────────────────────────────────────────────┘
TO_DAY_OF_WEEK(<expr>)
引数 説明
<expr> 日付/タイムスタンプ

``TINYINT`

SELECT
to_day_of_week('2023-11-12 09:38:18.165575')
┌──────────────────────────────────────────────┐
│ to_day_of_week('2023-11-12 09:38:18.165575') │
│ UInt8 │
├──────────────────────────────────────────────┤
│ 7 │
└──────────────────────────────────────────────┘