MICROSECONDS
MICROSECONDS(n)
Constructs a microsecond_interval
value that refers to a duration of n
microseconds.
SELECT TYPEOF(MICROSECONDS(1000000))
SELECT TIME '10:10:10' + MICROSECONDS(1000000)
MILLISECONDS
MILLISECONDS(n)
Constructs a microsecond_interval
value that refers to a duration of n
milliseconds.
SELECT TYPEOF(MILLISECONDS(1000))
SELECT TIME '10:10:10' + MILLISECONDS(1000)
SECONDS
TIMESTAMP_SECONDS(n)
Constructs value of type timestamp
from n
seconds since the Unix epoch.
SELECT TYPEOF(SECONDS(1))
SELECT TIME '10:10:10' + SECONDS(1)
MINUTES
MINUTES(n)
Constructs a microsecond_interval
value that refers to a duration of n
minutes.
SELECT TYPEOF(MINUTES(1))
SELECT TIME '10:10:10' + MINUTES(1)
HOURS
HOURS(n)
Constructs a microsecond_interval
value that refers to a duration of n
hours.
SELECT TYPEOF(HOURS(1))
SELECT TIME '10:10:10' + HOURS(1)
DAYS
DAYS(n)
Constructs a microsecond_interval
value that refers to a duration of n
days.
SELECT TYPEOF(DAYS(1))
SELECT DATE '2019-08-17' + DAYS(1)
MONTHS
MONTHS(n)
Constructs a month_interval
value that refers to a duration of n
months.
SELECT TYPEOF(MONTHS(1))
SELECT DATE '2019-08-17' + MONTHS(1)
YEARS
YEARS(n)
Constructs a month_interval
value that refers to a duration of n
years.
Constructs a month_interval
value that refers to a duration of n
years.
SELECT TYPEOF(YEARS(1))
SELECT DATE '2019-09-17' + YEARS(1)
PARSE_DURATION_SECONDS
PARSE_DURATION_SECONDS(s)
Parses a microsecond_interval
value from a string.
Supported formats are:
[-]HH:MM:SS[.nnnnnn]
[-]MM:SS[.nnnnnn]
[-]SS[.nnnnnn]
SELECT PARSE_DURATION_SECONDS('10:23.1')
SELECT TYPEOF(PARSE_DURATION_SECONDS('10:23.1'))
SELECT DATETIME '2018-05-26T10:30:20.345' + PARSE_DURATION_SECONDS('10:23.1')
PARSE_DURATION_MONTHS
PARSE_DURATION_MONTHS(s)
Parses a month_interval
value from a string.
Supported formats are:
[-]Y-M
[-]M
SELECT PARSE_DURATION_MONTHS('1-1')
SELECT TYPEOF(PARSE_DURATION_MONTHS('1-1'))
SELECT DATETIME '2018-05-26T10:30:20.345' + PARSE_DURATION_MONTHS('1-1')