NULLIFZERO in Teradata

It is one of the very important Teradata functions converting zero to null value when divide-by-zero problem comes into picture.
NULLIFZERO is a Teradata extension to the ANSI SQL-99 standard.

 SELECT NULLIFZERO(column) FROM table; // Column level and expression level

If the argument is not numeric, it is converted to a numeric value, based on implicit type conversion rules.
If arg is a character string, it is converted to a numeric value of FLOAT data type.
If the argument cannot be converted, an error is reported.


100/x - In this expression if x is zero then error will be thrown.
100/NULLIFZERO(x) - In this expression we are handling the problem with the function and it will return null.

When you want to select a column which has more '0' then you can also use this function to represent (nulls) like:

FROM cars WHERE companyID=201