mysql - how to include zeros in the count in only one single query -
i have 1 table count, not using join. possible?
select engagement_type name, count(engagement_type) y events group engagement_type order engagement_type
but result 1 row count per engagement_type. want show count of accounts without engagement_type. these:
will appreciate answers! thanks!
if there lookup-table, engagementtypes
, possible values of engagement types stored, can query table full list of types , left join
events
table in order corresponding count:
select t1.engagement_type name, count(t2.engagement_type) y engagementtypes t1 left join events t2 on t1.engagement_type = t2.engagement_type group t1.engagement_type order t1.engagement_type
Comments
Post a Comment