2017-10-12 40 views

回答

0

使用UNION ALL:

select Team_id, sum(Game_count) as 'Game_count' 
from (
    select Team_1 as 'Team_id', count(*) as 'Game_count' 
    from games 
    group by Team_1 
    union all 
    select Team_2, count(*) 
    from games 
    group by Team_2 
) as q 

組由TEAM_ID

+0

感謝那些工作! –

相關問題