跳转到内容

将指定数量的分钟转换为 Interval 类型。

  • 接受正整数、零和负整数作为输入。
func.to_minutes(<minutes>)
func.to_minutes(2)
┌──────────────────────────────────────────────────────┐
│ func.to_minutes(2) │
├──────────────────────────────────────────────────────┤
│ 0:02:00 │
└──────────────────────────────────────────────────────┘
TO_MINUTES(<minutes>)

Interval(格式为 hh:mm:ss)。

SELECT TO_MINUTES(2), TO_MINUTES(0), TO_MINUTES((- 2));
┌─────────────────────────────────────────────────┐
│ to_minutes(2) │ to_minutes(0) │ to_minutes(- 2) │
├───────────────┼───────────────┼─────────────────┤
│ 0:02:00 │ 00:00:00 │ -0:02:00 │
└─────────────────────────────────────────────────┘