to_ck/活跃账号视图.sql
2021-08-03 17:51:21 +08:00

11 lines
463 B
SQL

drop table if exists xiangsu.active_account;
create view xiangsu.active_account as
select toDate(addHours(`#event_time`, `#zone_offset`)) as date,
`#os`,
`#bundle_id`,
owner_name,
channel,
uniqCombined(binduid) as num,
arrayDistinct(groupArray(binduid)) as account
from xiangsu.event
group by toDate(addHours(`#event_time`, `#zone_offset`)), `#os`, `#bundle_id`, owner_name, channel