Ir al contenido

Devuelve el cociente de dividir el primer número entre el segundo. Devuelve NULL si el segundo número es 0 o NULL.

Consulte también:

func.divnull(<numerator>, <denominator>)
func.divnull(20, 6), func.divnull(20, 0), func.divnull(20, null)
┌───────────────────────────────────────────────────────────────────┐
│ func.divnull(20, 6)│ func.divnull(20, 0) │ func.divnull(20, null) │
├────────────────────┼─────────────────────┼────────────────────────┤
│ 3.3333333333333335 │ NULL │ NULL │
└───────────────────────────────────────────────────────────────────┘
DIVNULL(<number1>, <number2>)
SELECT
DIVNULL(20, 6),
DIVNULL(20, 0),
DIVNULL(20, NULL);
┌─────────────────────────────────────────────────────────┐
│ divnull(20, 6) │ divnull(20, 0) │ divnull(20, null) │
├────────────────────┼────────────────┼───────────────────┤
│ 3.3333333333333335 │ NULL │ NULL │
└─────────────────────────────────────────────────────────┘