When Can I use the syntax WHERE IS .... and Where ..=..
I see some posts saying Null can only be used with IS, but what else I can use IS with?
Thanks in advance
When Can I use the syntax WHERE IS .... and Where ..=..
I see some posts saying Null can only be used with IS, but what else I can use IS with?
Thanks in advance
Besides IS [NOT] NULL
there are several predicates based on IS
in Standard SQL, see SQL 2016 BNF syntax
6.39 <boolean value expression> Function
Specify a boolean value.
...
<boolean test> ::=
<boolean primary> [ IS [ NOT ] <truth value> ]
<truth value> ::=
TRUE
| FALSE
| UNKNOWN
8.12 <normalized predicate> Function
Determine whether a character string value is normalized. Format
<normalized predicate> ::= <row value predicand> <normalized predicate part 2>
<normalized predicate part 2> ::= IS [ NOT ] [ <normal form> ] NORMALIZED
8.15 <distinct predicate> Function
Specify a test of whether two row values are distinct Format
<distinct predicate> ::= <row value predicand 3> <distinct predicate part 2>
<distinct predicate part 2> ::= IS [ NOT ] DISTINCT FROM <row value predicand 4>
8.18 <set predicate>
Function
Specify a test of whether a multiset is a set (that is, does not contain any duplicates).
Format
<set predicate> ::=
<row value predicand> <set predicate part 2>
<set predicate part 2> ::=
IS [ NOT ] A SET
8.19 <type predicate>
Function
Specify a type test.
Format
<type predicate> ::=
<row value predicand> <type predicate part 2>
<type predicate part 2> ::=
IS [ NOT ] OF <left paren> <type list> <right paren>
8.22 <JSON predicate>
Function
Test whether a string value is a JSON text.
Format
<JSON predicate> ::=
<string value expression> [ <JSON input clause> ]
IS [ NOT ] JSON
[ <JSON predicate type constraint> ]
[ <JSON key uniqueness constraint> ]
But DBMS support is usually low, e.g. PostgreSQL supports boolean/type/distinct predicates (and that's probably more than others)