TO_MONTH(Lakehouse v1)
日付または日時(タイムスタンプ/datetime)を、月の番号(1~12)を表す UInt8 の数値に変換します。
Analyze 構文
Section titled “Analyze 構文”func.to_month(<expr>)Analyze の例
Section titled “Analyze の例”func.now(), func.to_month(func.now()), func.month(func.now())
┌─────────────────────────────────────────────────────────────────────────────────┐│ func.now() │ func.to_month(func.now()) │ func.month(func.now()) │├────────────────────────────┼───────────────────────────┼────────────────────────┤│ 2024-03-14 23:34:02.161291 │ 3 │ 3 │└─────────────────────────────────────────────────────────────────────────────────┘SQL 構文
Section titled “SQL 構文”TO_MONTH(<expr>)| 引数 | 説明 |
|---|---|
<expr> |
日付/タイムスタンプ |
TINYINT
SQL の例
Section titled “SQL の例”SELECT NOW(), TO_MONTH(NOW()), MONTH(NOW());
┌─────────────────────────────────────────────────────────────┐│ now() │ to_month(now()) │ month(now()) │├────────────────────────────┼─────────────────┼──────────────┤│ 2024-03-14 23:34:02.161291 │ 3 │ 3 │└─────────────────────────────────────────────────────────────┘