ZEROIFNULL in Teradata

ZEROIFNULL is used to handle the null values by converting them into zeroes. Usually NULL checks happen in where clause by rendering IS NULL then the appropriate values will be grouped for anaysis purposes. Teradata uses ZEROIFNULL to convert null values, since it is always better to avoid nulls for calculator analysis and a value is always preferred than a null.

Syntax:
SELECT ZEROIFNULL (column) FROM table; // Column level and expression level


Example:
column1
0
?
3

SELECT ZEROIFNULL (column1) FROM table;

Output:
0
0
3

Explanation:
ZEROIFNULL will present zero if a null otherwise it represents the actual value.