Leetcode SQL 50 / Confirmation rate / Leetcode SQL problem

preview_player
Показать описание

Рекомендации по теме
Комментарии
Автор

man you did it the hard way.. I think there is a simple way to right out the code for us beginners 
select s.user_id,
ifnull (round(sum(if(c.action ='confirmed', 1, 0)) /count(c.action), 2), 0) as confirmation_rate
from Signups as s
left join Confirmations as c
on s.user_id = c.user_id
group by s.user_id

containthis
welcome to shbcf.ru