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

异常的邮件概率

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

select f.date,round((1-sum(f.type2)/count(f.type2)),3)p
from
(select e.send_id,e.receive_id,(case when e.type='completed' then 1
                                    when e.type='no_completed' then 0
                                    end)type2,e.date,e.b1,e.b2
from 
(select c.*,d.is_blacklist b2
from
(select a.*,b.is_blacklist b1
from email a 
join user b
on a.send_id=b.id and b.is_blacklist=0) c
join
user d
on c.receive_id=d.id and d.is_blacklist=0)e)f
group by f.date order by f.date;

全部评论

相关推荐

05-14 20:34
门头沟学院 Java
窝补药贝八股:管他们,乱说,反正又不去,直接说680
点赞 评论 收藏
分享
程序员牛肉:这一眼假啊,基本上都是骗人的,不然就涉及到职位贪腐了,就像之前华为的OD事件,看你运气好不好了
点赞 评论 收藏
分享
06-04 17:59
已编辑
长江大学 Java
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务