select date,sum(case when result='win' then 1 else 0 end) win,sum(case when result='lose' then 1 else 0 end) lose from tbl group by date;