17 lines
1.1 KiB
SQL
17 lines
1.1 KiB
SQL
create view new_account_recharge as (select date,
|
|
arrayMap((x, y) -> (x, y),groupArray(binduid), groupArray(money)) as bid_money
|
|
from (select date, binduid, money
|
|
from (select date, account, binduid, money
|
|
from (SELECT toDate(addHours(`#event_time`, `#zone_offset`)) AS date,
|
|
arrayDistinct(groupArray(binduid)) AS account
|
|
FROM zhengba.event
|
|
WHERE role_idx = 1
|
|
GROUP BY toDate(addHours(`#event_time`, `#zone_offset`))) as tb1
|
|
left join (select toDate(addHours(`#event_time`, `#zone_offset`)) as date,
|
|
binduid,
|
|
sum(money) as money
|
|
from zhengba.event
|
|
where `#event_name` = 'rechargeGame'
|
|
group by toDate(addHours(`#event_time`, `#zone_offset`)), binduid ) as tb2
|
|
on tb1.date = tb2.date)
|
|
where has(account, binduid)) group by date) |