select cur_y, count_cur, count_old, (count_cur - count_old) / 100 * count_old as total
from (
select cur_y, count(tb1.field) as count_cur, count(tb2.field) as count_old
from (select year(fielddate) as cur_y, (year(fielddate)-1) as old_y from tablename group by year(fielddate)) as yy
left join tablename tb1 on year(tb1.fielddate) = yy.cur_y
left join tablename tb2 on year(tb2.fielddate) = yy.old_y
group by cur_y
) as tmp
order by cur_y
select
cur_y,
count_cur,
count_old,
(count_cur - count_old) * count_old / 100 as total
from (
select
cur_y,
count(tb1.field) as count_cur,
count(tb2.field) as count_old
from (
select
year(fielddate) as cur_y,
(year(fielddate)-1) as old_y
from tablename
group by year(fielddate)
) as yy
left join tablename tb1 on year(tb1.fielddate) = yy.cur_y
left join tablename tb2 on year(tb2.fielddate) = yy.old_y
group by cur_y
) as tmp
where ............................................
order by cur_y
select
cur_y,
count(case month(tb1.fieldate) when 1 then 1 else null end) as cur_jan,
count(case month(tb1.fieldate) when 2 then 1 else null end) as cur_feb,
.....
count(case month(tb2.fieldate) when 1 then 1 else null end) as old_jan,
count(case month(tb2.fieldate) when 2 then 1 else null end) as old_feb,