to_ck/新用户视图.sql
2021-07-21 15:32:49 +08:00

12 lines
476 B
SQL

drop table if exists zhengba.new_account;
create view zhengba.new_account as
select toDate(addHours(`#event_time`, `#zone_offset`)) as date,
`#os`,
`#bundle_id`,
owner_name,
channel,
groupArray(`binduid`) as account,
length(account) as num
from zhengba.event
where role_idx = 1
group by toDate(addHours(`#event_time`, `#zone_offset`)), `#os`, `#bundle_id`, owner_name, channel