大数据统计回流用户

use applogsdb;

msck repair table ext_startup_logs;

select distinct deviceid from sockinfo
where appid='sdk34734' and concat(ym,day) >= formattime(getweekbegin(),'yyyyMMdd');


上周回流
select distinct deviceid from ext_startup_logs
where appid='sdk34734' and concat(ym,day) >= formattime(getweekbegin(-1),'yyyyMMdd')
and concat(ym,day) < formattime(getweekbegin(),'yyyyMMdd')
and deviceid not in
(
select distinct deviceid from ext_startup_logs
where appid='sdk34734' and concat(ym,day) >= formattime(getweekbegin(-2),'yyyyMMdd')
and concat(ym,day) < formattime(getweekbegin(-1),'yyyyMMdd')
);

posted @ 2020-05-12 21:22  潇洒哥浩浩  阅读(339)  评论(0)    收藏  举报