新浪数据分析笔试编程第三题AC分享

我最后提交的代码AC了,但是没有复制下来,这是中途在IDE写的,也修改了下,仅供参考。
select temp1.channel_type,round( (temp1.avgRead-temp2.avgRead)*1.0/temp2.avgRead,4) as escalate
from
(select channel_type,count(newsid)*1.0 / count(distinct A.uid) as avgRead
from user_read as A join new_user_info as B
on A.uid = B.uid
where new_dt = '2018-07-08' and dt = '20180708'
group by channel_type) as temp1
join
(select channel_type,count(newsid)*1.0 / count(distinct A.uid) as avgRead
from user_read as A join new_user_info as B
on A.uid = B.uid
where new_dt = '2018-07-07' and dt = '20180707'
group by channel_type) as temp2 on temp1.channel_type = temp2.channel.type
order by escalate

#新浪##笔试题目#
全部评论
想问楼主收到面试通知了吗
点赞 回复 分享
发布于 2018-09-30 17:05
用户id忘了distinct😂😂耽误了20分钟😂一直报错
点赞 回复 分享
发布于 2018-09-15 23:53
乘以1.0是因为?整数相除自动取整了?
点赞 回复 分享
发布于 2018-09-15 23:46
那你第二题A过了吗
点赞 回复 分享
发布于 2018-09-15 23:28
啊,sorry,倒数第二行最后的temp2.channel.type应该是temp2.channel_type,但我提交时改了的。
点赞 回复 分享
发布于 2018-09-15 23:24

相关推荐

05-24 14:12
门头沟学院 Java
点赞 评论 收藏
分享
不愿透露姓名的神秘牛友
07-10 14:10
啊啊啊啊好幸福,妈妈是我找工作发疯前的一束光
黑皮白袜臭脚体育生:看了这篇帖子之后已经第一百次质问老妈,仍然没有得到我的老妈是老板的回答
点赞 评论 收藏
分享
评论
点赞
24
分享

创作者周榜

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