题解 | #异常的邮件概率#简单题

异常的邮件概率

https://www.nowcoder.com/practice/d6dd656483b545159d3aa89b4c26004e

# 先查找出正常用户的id
with t1 as (
    select id
    from user
    where is_blacklist = 0
)
# 找到正常用户发送给正常用户的邮件记录
select date, ROUND(sum(type='no_completed')/count(id), 3) as p
from email
where send_id in (select id from t1)
and receive_id in (select id from t1)
group by date
order by date;

全部评论

相关推荐

投递中移(苏州)软件技术有限公司等公司6个岗位 > 牛客解忧铺
点赞 评论 收藏
转发
点赞 收藏 评论
分享
牛客网
牛客企业服务