to_ck/活跃账号视图.sql
2021-07-21 15:32:49 +08:00

11 lines
463 B
SQL

drop table if exists zhengba.active_account;
create view zhengba.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 zhengba.event
group by toDate(addHours(`#event_time`, `#zone_offset`)), `#os`, `#bundle_id`, owner_name, channel