TO_CENTURIES(Lakehouse v1)
将指定数量的世纪转换为 Interval 类型。
- 接受正整数、零和负整数作为输入。
Analyze 语法
Section titled “Analyze 语法”func.to_centuries(<centuries>)Analyze 示例
Section titled “Analyze 示例”func.to_centuries(2)┌──────────────────────────────────────────────────────┐│ func.to_centuries(2) │├──────────────────────────────────────────────────────┤│ 200 years │└──────────────────────────────────────────────────────┘SQL 语法
Section titled “SQL 语法”TO_CENTURIES(<centuries>)Interval(以年表示)。
SQL 示例
Section titled “SQL 示例”SELECT TO_CENTURIES(2), TO_CENTURIES(0), TO_CENTURIES(-2);
┌───────────────────────────────────────────────────────┐│ to_centuries(2) │ to_centuries(0) │ to_centuries(- 2) │├─────────────────┼─────────────────┼───────────────────┤│ 200 years │ 00:00:00 │ -200 years │└───────────────────────────────────────────────────────┘