to_ck/新用户视图.sql
2021-08-03 17:51:21 +08:00

12 lines
476 B
SQL

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