跳到主要内容

TO_HOURS

Introduced or updated: v1.2.677

Converts a specified number of hours into an Interval type.

  • Accepts positive integers, zero, and negative integers as input.

Syntax

TO_HOURS(<hours>)

Return Type

Interval (in the format hh:mm:ss).

Examples

SELECT TO_HOURS(2), TO_HOURS(0), TO_HOURS((- 2));

┌───────────────────────────────────────────┐
│ to_hours(2) │ to_hours(0) │ to_hours(- 2)
├─────────────┼─────────────┼───────────────┤
2:00:0000:00:00-2:00:00
└───────────────────────────────────────────┘
开始使用 Databend Cloud
低成本
快速分析
多种数据源
弹性扩展
注册