▶학습내용
문제1)
select game_account_id,actor_cnt,avg_amount
from
(
select u.game_account_id,count(distinct u.game_actor_id)as actor_cnt,avg(p.total_amt)as avg_amount
from
(
select*
from basic.users
where serverno>=2
)as u
inner join
(
select game_account_id,sum(pay_amount)as total_amt
from basic.payment as p
where pay_type='CARD'
group by game_account_id
)as p
on u.game_account_id=p.game_account_id
group by u.game_account_id
) as k
where actor_cnt>=2
order by avg_amount desc
-> 조인 응용문제