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/nvl2 below:

NVL2 | Snowflake Documentation

Reference Function and stored procedure reference Conditional expression NVL2
Categories:

Conditional expression functions

NVL2

Returns values depending on whether the first input is NULL:

Syntax
NVL2( <expr1> , <expr2> , <expr3> )

Copy

Arguments
expr1

The expression to be checked to see whether it is NULL.

expr2

If expr1 is not NULL, this expression will be evaluated and its value will be returned.

expr3

If expr1 is NULL, this expression will be evaluated and its value will be returned.

Usage notes Collation details Examples

If a is not null, then return b, else return c:

SELECT a, b, c, NVL2(a, b, c) FROM i2;

--------+--------+--------+---------------+
   A    |   B    |   C    | NVL2(A, B, C) |
--------+--------+--------+---------------+
 0      | 5      | 3      | 5             |
 0      | 5      | [NULL] | 5             |
 0      | [NULL] | 3      | [NULL]        |
 0      | [NULL] | [NULL] | [NULL]        |
 [NULL] | 5      | 3      | 3             |
 [NULL] | 5      | [NULL] | [NULL]        |
 [NULL] | [NULL] | 3      | 3             |
 [NULL] | [NULL] | [NULL] | [NULL]        |
--------+--------+--------+---------------+

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