Skip to content

Returns the quotient by dividing the first number by the second one. Returns 0 if the second number is 0.

See also:

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