SQLite Forum

Bug when converting string to boolean?
Login
> This is obviously a semantics or usage argument

Perhaps technically, but if `typeof(NULL)` is anything but NULL, then NULL is incorrectly implemented: null is the value that is equal to nothing else in SQL, not even to itself:

```
sqlite> select 1 where null = null;
sqlite> 
```

> It would be more accurate to say that possible nullity is a feature of all types

If you cannot compare NULL to NULL, then there is no useful meaning to that wish:

```
sqlite> create table a(b int);
sqlite> insert into a values (1),(null);
sqlite> select rowid, b from a;
1|1
2|
sqlite> select rowid from a where b=null;
sqlite> select rowid from a where b IS null;
2
```

In other words, there is no row in `a` where `b` equals `NULL`. Thus the `IS NULL` SQL operator.

Here, `b` on row ID 2 is not an integer with value NULL, it simply **IS NULL**. It is not an integer at all. It is also not a `TEXT` or a Boolean, or a `REAL`, or...