SELECT COALESCE(sum(CASE WHEN myCol THEN 1 ELSE 0 END),0) FROM <table name>
oppure, come hai scoperto tu stesso:
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>
oppure, come hai scoperto tu stesso:
SELECT count(CASE WHEN myCol THEN 1 END) FROM <table name>