- Overview
- Data types
- Commands
- Functions
- Overview
- Aggregate
- Conditional expression
- Conversion
- Date and time
- Numeric
- String
- Semi-structured data
On this page
IS [ NOT ]
Compares whether two expressions are equal (or not equal). The function is NULL-safe, meaning it treats NULLs as known values for comparing equality. Note that this is different from the EQUAL comparison operator (=), which treats NULLs as unknown values.
Syntax
<expr1> IS [ NOT ] <expr2>
Returns
The value returned depends on whether any of the inputs are NULL values:
- Returns TRUE, if:
<null> IS NOT <null>
<null> IS <not_null>
<not_null> IS <null>
- Returns FALSE, if:
<null> IS <null>
<null> IS NOT <not_null>
<not_null> IS NOT <null>
- Otherwise,
<expr1> IS <expr2>
is equivalent to<expr1> != <expr2>
<expr1> IS NOT <expr2>
is equivalent to<expr1> = <expr2>