Combine avg() and if() functions "Avg(if())" in mySQL
I have the below table: s.userid c.userid c.action 3 3 timeout 3 3 timeout 7 7 confirmed 7 7 confirmed 7 7 confirmed 2 2 timeout 2 2 confirmed For a given s.user_id, I am trying to calculate count(confirmed)/ (count(confirmed)…