In Mysql and Oracle, and apparently SQL-Server, you can use nullif (ignore from dual for SQL-Server), so assuming you accept null as true, you can handle equality testing this way without a messy case or deal with strings.
SQL> select nullif(1,0) from dual; NULLIF(1,0) ----------- 1 SQL> select nullif(1,1) from dual; NULLIF(1,1) ----------- SQL>
source share