题目描述
leetcode题目:1934. 确认率
Code
select
Signups.user_id,
ifnull(confirmation_rate1, 0) as confirmation_rate
from Signups
left join(
select
user_id,
round(sum(if(action='confirmed', 1, 0))/count(*), 2) as confirmation_rate1
from Confirmations
group by user_id
) A on A.user_id = Signups.user_id
执行用时分布628ms,击败60.46%使用 MySQL 的用户