Interval Durations

DURATION_MICROS

DURATION_MICROS(interval) Returns the duration of a microsecond_interval in microseconds.

SELECT DURATION_MICROS(SECONDS(1))
1000000
SELECT DURATION_MICROS(HOURS(1))
3600000000

DURATION_MILLIS

DURATION_MILLIS(interval) Returns the duration of a microsecond_interval in milliseconds.

SELECT DURATION_MILLIS(SECONDS(1))
1000
SELECT DURATION_MILLIS(HOURS(1))
3600000

DURATION_SECONDS

PARSE_DURATION_SECONDS(s) Parses a microsecond_interval value from a string.

SELECT DURATION_SECONDS(SECONDS(1))
1
SELECT DURATION_SECONDS(HOURS(1))
3600

DURATION_MONTHS

PARSE_DURATION_MONTHS(s) Parses a month_interval value from a string.

SELECT DURATION_MONTHS(YEARS(2))
24