SELECT COALESCE(sum(CASE WHEN myCol THEN 1 ELSE 0 END),0) FROM <table name>
of, zoals je zelf hebt ontdekt:
SELECT count(CASE WHEN myCol THEN 1 END) FROM <table name>
SELECT COALESCE(sum(CASE WHEN myCol THEN 1 ELSE 0 END),0) FROM <table name>
of, zoals je zelf hebt ontdekt:
SELECT count(CASE WHEN myCol THEN 1 END) FROM <table name>