A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.snowflake.com/sql-reference/functions/zeroifnull below:

Website Navigation


ZEROIFNULL | Snowflake Documentation

ZEROIFNULL

Returns 0 if its argument is null; otherwise, returns its argument.

Syntax Arguments
expr

The input should be an expression that evaluates to a numeric value (or NULL).

Returns

If the value of the input expressions is NULL, this returns 0. Otherwise, this returns the value of the input expression.

The data type of the return value is NUMBER(p, s). The exact values of ‘p’ (precision) and ‘s’ (scale) depend upon the input expression. For example, if the input expression is 3.14159, then the data type of the output value will be NUMBER(7, 5).

Examples

The following example shows the output of the function for various input values:

SELECT column1, ZEROIFNULL(column1) 
    FROM VALUES (1), (null), (5), (0), (3.14159);
+---------+---------------------+
| COLUMN1 | ZEROIFNULL(COLUMN1) |
|---------+---------------------|
| 1.00000 |             1.00000 |
|    NULL |             0.00000 |
| 5.00000 |             5.00000 |
| 0.00000 |             0.00000 |
| 3.14159 |             3.14159 |
+---------+---------------------+

Copy


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4