TO_QUARTER(Lakehouse v1)
从给定的日期或时间戳中检索季度(1、2、3 或 4)。
Analyze 语法
Section titled “Analyze 语法”func.to_quarter(<expr>)Analyze 示例
Section titled “Analyze 示例”func.now(), func.to_quarter(func.now()), func.quarter(func.now())
┌─────────────────────────────────────────────────────────────────────────────────────┐│ func.now() │ func.to_quarter(func.now()) │ func.quarter(func.now()) │├────────────────────────────┼─────────────────────────────┼──────────────────────────┤│ 2024-03-14 23:32:52.743133 │ 3 │ 3 │└─────────────────────────────────────────────────────────────────────────────────────┘SQL 语法
Section titled “SQL 语法”TO_QUARTER( <date_or_time_expr> )整数。
SQL 示例
Section titled “SQL 示例”SELECT NOW(), TO_QUARTER(NOW()), QUARTER(NOW());
┌─────────────────────────────────────────────────────────────────┐│ now() │ to_quarter(now()) │ quarter(now()) │├────────────────────────────┼───────────────────┼────────────────┤│ 2024-03-14 23:32:52.743133 │ 1 │ 1 │└─────────────────────────────────────────────────────────────────┘