Verwenden Sie <=>
SELECT NOT 1 <=> 1,NOT NULL <=> NULL, NOT 1 <=> NULL, NOT 1 <=> 2, 1 <> 1, NULL <> NULL, 1 <> NULL, 1 <>2;
+-------------+-------------------+----------------+-------------+--------+--------------+-----------+-------+
| NOT 1 <=> 1 | NOT NULL <=> NULL | NOT 1 <=> NULL | NOT 1 <=> 2 | 1 <> 1 | NULL <> NULL | 1 <> NULL | 1 <>2 |
+-------------+-------------------+----------------+-------------+--------+--------------+-----------+-------+
| 0 | 0 | 1 | 1 | 0 | NULL | NULL | 1 |
+-------------+-------------------+----------------+-------------+--------+--------------+-----------+-------+
PS. Tut mir leid, ich hätte das Handbuch lesen sollen, bevor ich eine Frage poste, aber hoffentlich hilft es jemand anderem.