全部评论
欢迎各位大佬指正 1. select a.type, sum(a.vnum)/count(a.uid) as avg,
round(
sum(case when a.date='20180711'then a.vnum else 0 end)/count(distinct case when a.date='20180711'then a.uid else null end)
-sum(case when a.date='20180710' then a.vnum else 0 end)/count(distinct case when a.date='20180710'then a.uid else null end),
4)as increase
from(
select v.date as date, v.uid as uid, v.vid as vid,
info.channel_type as type, count(vid) as vnum from
user_video as v left join new_user_info as info on v.uid=info.uid
where v.date in ('20180710','20180711')group by date,uid,type
)a
group by a.type; 2. select uid from(
select a.date,a.uid,
sum(if(date>='20190801'and date<='20190807',1,0))as num1,
sum(if(date='20190808',1,0))as num2
from(
select v.date,v.uid from user_video v join user_info i on
v.uid=i.uid
where v.tag='美食' and i.age<=25 and i.gender='女'
)a group by a.uid
)b where b.num1>10 and b.num2<3;
3. select a.tag,max(a.num)-min(a.num)from(
select tag,uid,count(distinct vid) as num from user_video group by tag,uid
) a
group by a.tag;
相关推荐
11-23 03:19
University of Miami Java 点赞 评论 收藏
分享
10-16 12:29
携程_移动安全研发 Yushuu:你的确很厉害,但是有一个小问题:谁问你了?我的意思是,谁在意?我告诉你,根本没人问你,在我们之中0人问了你,我把所有问你的人都请来 party 了,到场人数是0个人,誰问你了?WHO ASKED?谁问汝矣?誰があなたに聞きましたか?누가 물어봤어?我爬上了珠穆朗玛峰也没找到谁问你了,我刚刚潜入了世界上最大的射电望远镜也没开到那个问你的人的盒,在找到谁问你之前我连癌症的解药都发明了出来,我开了最大距离渲染也没找到谁问你了我活在这个被辐射蹂躏了多年的破碎世界的坟墓里目睹全球核战争把人类文明毁灭也没见到谁问你了😆
点赞 评论 收藏
分享