新浪数据分析笔试编程第三题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

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

相关推荐

点赞 评论 收藏
分享
评论
点赞
24
分享

创作者周榜

更多
牛客网
牛客企业服务