try_divide
function
Applies to: Databricks SQL Databricks Runtime 10.4 LTS and above
Returns dividend
divided by divisor
, or NULL if divisor
is 0.
Returns
If both dividend
and divisor
are DECIMAL, the result is DECIMAL.
If dividend
is a year-month interval, the result is an INTERVAL YEAR TO MONTH
.
If divident
is a day-time interval, the result is an INTERVAL DAY TO SECOND
.
In all other cases, a DOUBLE.
If the divisor
is 0, the operator returns NULL.