A RetroSearch Logo

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

Search Query:

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

Website Navigation


NULLIFZERO | Snowflake Documentation

Categories:

Conditional expression functions

NULLIFZERO

Returns NULL if the argument evaluates to 0; otherwise, returns the argument.

Syntax Arguments
expr

The input should be an expression that evaluates to a numeric value.

Returns

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

The data type of the return value is NUMBER(p, s) (if the input is a fixed-point number) or DOUBLE (if the input is a floating point number).

For fixed-point numbers, 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 examples show the output of the function for various input values:

SELECT NULLIFZERO(0);
+---------------+
| NULLIFZERO(0) |
|---------------|
|          NULL |
+---------------+

Copy

SELECT NULLIFZERO(52);
+----------------+
| NULLIFZERO(52) |
|----------------|
|             52 |
+----------------+

Copy

SELECT NULLIFZERO(3.14159);
+---------------------+
| NULLIFZERO(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