DIV0

import FunctionDescription from '@site/src/components/FunctionDescription';

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

See also:

Analyze Syntax

func.div0(<numerator>, <denominator>)

Analyze Examples

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.3333333333333335                 0  NULL                
└─────────────────────────────────────────────────────────────┘

SQL Syntax

DIV0(<number1>, <number2>)

SQL Examples

SELECT
  DIV0(20, 6),
  DIV0(20, 0),
  DIV0(20, NULL);

┌───────────────────────────────────────────────────┐
     div0(20, 6)     div0(20, 0)  div0(20, null) 
├────────────────────┼─────────────┼────────────────┤
 3.3333333333333335            0  NULL           
└───────────────────────────────────────────────────┘
Last modified April 23, 2024 at 12:42 PM EST: updating numerical functions (2a94341)