SQLite Forum

bug report : adding constant to GROUP BY leads to different output
NULL is a constant and it is False.  

For the purposes of GROUP BY and DISTINCT, the grouping comparison is 'IS' not '==' so NULL compares equal to NULL and all NULL form a single group just like any other value.