Here you go.
SELECT countrycode
, COALESCE(SUM(CASE WHEN label="A" THEN 1 END)/COUNT(*),0) a
FROM my_table
GROUP
BY countrycode;
You can figure out the rest.
4
solved how find count average using mysql?
Here you go.
SELECT countrycode
, COALESCE(SUM(CASE WHEN label="A" THEN 1 END)/COUNT(*),0) a
FROM my_table
GROUP
BY countrycode;
You can figure out the rest.
4
solved how find count average using mysql?