select
`Year`,
sum(`Jan`) as `Jan`,
sum(`Feb`) as `Feb`,
sum(`Mar`) as `Mar`,
sum(`Apr`) as `Apr`,
sum(`May`) as `May`,
sum(`Jun`) as `Jun`,
sum(`Jul`) as `Jul`,
sum(`Aug`) as `Aug`,
sum(`Sep`) as `Sep`,
sum(`Oct`) as `Oct`,
sum(`Nov`) as `Nov`,
sum(`Dec`) as `Dec`,
sum(`Total`) as `Total`
from
(select year(`re_date`) as `Year`,
case month(`re_date`) when 1 then count(`re_date`) else null end as `Jan`,
case month(`re_date`) when 2 then count(`re_date`) else null end as `Feb`,
case month(`re_date`) when 3 then count(`re_date`) else null end as `Mar`,
case month(`re_date`) when 4 then count(`re_date`) else null end as `Apr`,
case month(`re_date`) when 5 then count(`re_date`) else null end as `May`,
case month(`re_date`) when 6 then count(`re_date`) else null end as `Jun`,
case month(`re_date`) when 7 then count(`re_date`) else null end as `Jul`,
case month(`re_date`) when 8 then count(`re_date`) else null end as `Aug`,
case month(`re_date`) when 9 then count(`re_date`) else null end as `Sep`,
case month(`re_date`) when 10 then count(`re_date`) else null end as `Oct`,
case month(`re_date`) when 11 then count(`re_date`) else null end as `Nov`,
case month(`re_date`) when 12 then count(`re_date`) else null end as `Dec`,
count(`re_date`) as Total
from tb_request group by year(`re_date`), month(`re_date`))
as temp group by Year