查询结果:
SQL:
select `dateTime`, sum(`result`=(case when result='胜' then '胜' end)) as '胜', sum(`result`=(case when result='负' then '负' end)) as '负' from exam group by `dateTime`, `result`=(case when result='胜' then '胜' when result='负' then '负' end)
查询结果:
SQL:
select `dateTime`, sum(`result`=(case when result='胜' then '胜' end)) as '胜', sum(`result`=(case when result='负' then '负' end)) as '负' from exam group by `dateTime`, `result`=(case when result='胜' then '胜' when result='负' then '负' end)