SELECT User, COUNT(User) as count FROM Tests GROUP by User;
This works. However, if some User rows contains null values I get the following:
User count
0
u1 5
u2 3
u3 9
As you can see, the null value rows shows 0 count, however, it’s not really zero.
SELECT * FROM Tests WHERE IsNull(User) shows non zero actual value.
This makes me thing that I should change my original query so null User will be counted correctly.
Use
COUNT(*)instead:From documentation: