Closed cyberhuman closed 6 years ago
The standard SQL is IS [NOT] DISTINCT FROM, and it's supported by at least Postgre and Firebird.
IS [NOT] DISTINCT FROM
MySQL uses <=> instead of IS NOT DISTINCT FROM: https://dev.mysql.com/doc/refman/8.0/en/comparison-operators.html#operator_equal-to
<=>
IS NOT DISTINCT FROM
mysql> select 0 <=> 0, 0 <=> null, null <=> 0, null <=> null; +---------+------------+------------+---------------+ | 0 <=> 0 | 0 <=> null | null <=> 0 | null <=> null | +---------+------------+------------+---------------+ | 1 | 0 | 0 | 1 | +---------+------------+------------+---------------+ 1 row in set (0.00 sec)
sqlite uses IS and IS NOT instead of IS NOT DISTINCT FROM and IS DISTINCT FROM, respectively:
IS
IS NOT
IS DISTINCT FROM
sqlite> select 0 is 0, 0 is null, null is 0, null is null 1|0|0|1
Thanks for extensive description
Thank you :+1:
The standard SQL is
IS [NOT] DISTINCT FROM
, and it's supported by at least Postgre and Firebird.MySQL uses
<=>
instead ofIS NOT DISTINCT FROM
: https://dev.mysql.com/doc/refman/8.0/en/comparison-operators.html#operator_equal-tosqlite uses
IS
andIS NOT
instead ofIS NOT DISTINCT FROM
andIS DISTINCT FROM
, respectively: