add batch remove batch split batch show hidden batches hide batch
db<>fiddle
feedback about
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
sal
1val
2val
3val
@sql
select r.m_id, count(distinct case when r.sal = '1val' then r.login end) as `1val`,count(distinct case when r.sal = '2val' then r.login end) as `2val`,count(distinct case when r.sal = '3val' then r.login end) as `3val` from read_log r inner join mes m on m.id = r.m_id where YEAR(m.send_date) = YEAR(curdate()) group by r.m_id