解题思路:
先按dt, result分组,然后用case when把列转成行,最后sum起来。
select dt, sum(case when result='win' then cnt else 0 end) as win, sum(case when result='loss' then cnt else 0 end) as loss from ( select dt, result,count(1) as cnt from info group by 1,2 );