make_dt_interval
function
Applies to: Databricks SQL Databricks Runtime 10.4 LTS and above
Creates an interval from days
, hours
, mins
and secs
.
Arguments
days
: An integral number of days, positive or negativehours
: An integral number of hours, positive or negativemins
: An integral number of minutes, positive or negativesecs
: A number of seconds with the fractional part in microsecond precision.
Returns
An INTERVAL DAY TO SECOND
.
Unspecified arguments are defaulted to 0.
If you provide no arguments the result is an INTERVAL '0 00:00:00.000000000' DAY TO SECOND
.
The function is equivalent to executing:
INTERVAL days DAYS + INTERVAL hours HOURS + INTERVAL mins MINUTES + INTERVAL secs SECONDS
.
As such each unit can be outside of its natural range as well as negative.