跳转到内容

将指定数量的十年转换为 Interval 类型。

  • 接受正整数、零和负整数作为输入。
func.to_decades(<decades>)
func.to_decades(2)
┌──────────────────────────────────────────────────────┐
│ func.to_decades(2) │
├──────────────────────────────────────────────────────┤
│ 20 years │
└──────────────────────────────────────────────────────┘
TO_DECADES(<decades>)

Interval(以年表示)。

SELECT TO_DECADES(2), TO_DECADES(0), TO_DECADES((- 2));
┌─────────────────────────────────────────────────┐
│ to_decades(2) │ to_decades(0) │ to_decades(- 2) │
├───────────────┼───────────────┼─────────────────┤
│ 20 years │ 00:00:00 │ -20 years │
└─────────────────────────────────────────────────┘