SQLite Forum

When is "IS" used in SQLite?
Login
When you need to test semantic equality between things that do not necessarily have mathematical equality.

```
Examples 
5 IS 5       --> TRUE
5 IS 6       --> FALSE
5 IS NULL    --> FALSE
NULL == NULL --> NULL  (not mathematically equal, but )
NULL IS NULL --> TRUE  (they are semantically equivalent)
1 == TRUE    --> TRUE  (mathematically equal)
5 == TRUE    --> FALSE (not mathematically equal)
5 IS TRUE    --> TRUE  (semantically equal)

EDIT:
There is also testing semantic unequivalence (if that is a real word) using IS NOT:
5 IS NOT NULL    --> TRUE
NULL IS NOT NULL --> FALSE
NULL <> NULL     --> NULL

There is also "ISNULL" which is equivalent to "IS NULL" and sometimes a more easy statement to use, so that:
... WHERE a IS NULL;
is exactly the same as saying:
... WHERE a ISNULL;

```