题解 | #找到每个人的任务#

异常的邮件概率

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

  1. 本题主要考察子连接问题,通过筛选出send_id 和 receive_id 对用的 is_blacklist都不为1;
  2. 然后是对失败邮件的统计占比,注意保留的小数点位
select `date`, round(sum(if(type="completed", 0, 1))/count(send_id), 3) p
	from email
	where send_id not in (select id from `user` where is_blacklist=1)
        and receive_id not in (select id from `user` where is_blacklist=1)
	group by `date`;
全部评论

相关推荐

09-29 00:03
门头沟学院 Java
点赞 评论 收藏
分享
牛客96763241...:杭电✌️也是打完招呼,没人回吗
点赞 评论 收藏
分享
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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