SQLite Forum

Beginner's problem with left join.
Login
NULL values are not equal to anything, not even to other NULL values.

Replace `b.var6=NULL` by `b.var6 IS NULL`.

(There are also comparison operators `IS DISTINCT FROM` and `IS NOT DISTINCT FROM` that can tell the difference between null and non-null values. But that is getting too verbose, when you already know that you want to compare with NULL.)