How can I correctly count occurrences of the value '1' in my SQL Server table