How can use the function SUM() for bit columns in T-SQL?
When I try do it as below:
SELECT SUM(bitColumn) FROM MyTable;
I get the e
You could consider 0 as nulls and simply count the remaining values:
SELECT count(nullif(bitColumn, 0)) FROM MyTable;