新浪数据分析笔试第二道编程题求解答
新浪数据分析笔试编程第二题,怎么都想不通哇,跪求大佬解答!
题目要求在2018年7月7日的三十岁及以下的男性阅读财经新闻大于1条并且在2018年7月8日有阅读的人数
不是20180707并财经并男性并三十岁及以下然后group by uid后count > 1再取20180708阅读用户的交集吗?
select count(distinct newT.xx)
from ( (select distinct A.uid as xxfrom user_read A join user_info B
on A.uid = B.uid
where A.dt = '20180707' and A.newsarea = '财经'
and B.age <= 30 and B.gender='男'
group by A.uid
having count(newsid) > 1) temp1
join (select distinct A1.uid as xx
from user_read A1 join user_info B1
on A1.uid = B1.uid
where A1.dt = '20180708') temp2 on temp1.xx = temp2.xx) as newT
#新浪##数据分析师##笔试题目#