DIVNULL

Learn how to use the DIVNULL numeric function in PlaidCloud Lakehouse. Returns the quotient by dividing the first number by the second one. Includes syntax...

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

See also:

Analyze Syntax

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

Analyze Examples

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                   
└───────────────────────────────────────────────────────────────────┘

SQL Syntax

DIVNULL(<number1>, <number2>)

SQL Examples

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

┌─────────────────────────────────────────────────────────┐
   divnull(20, 6)    divnull(20, 0)  divnull(20, null) 
├────────────────────┼────────────────┼───────────────────┤
 3.3333333333333335  NULL            NULL              
└─────────────────────────────────────────────────────────┘