Returns NULL if expr1
is equal to expr2
, otherwise returns expr1
.
NULLIF( <expr1> , <expr2> )
Copy
Arguments¶expr1
Any general expression of any data type.
expr2
Any general expression that evaluates to the same data type as expr1
.
The data type of the returned value is the data type of expr1
.
The collation specifications of all input arguments must be compatible.
The collation of the result is the same as the collation of the first input.
SELECT a, b, NULLIF(a,b) FROM i; --------+--------+-------------+ a | b | nullif(a,b) | --------+--------+-------------+ 0 | 0 | [NULL] | 0 | 1 | 0 | 0 | [NULL] | 0 | 1 | 0 | 1 | 1 | 1 | [NULL] | 1 | [NULL] | 1 | [NULL] | 0 | [NULL] | [NULL] | 1 | [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