create table acdyr
acdyrid acdyr acdfromdt acdtodt
-----------------------------------------------------------
1 2012-13 01-06-2012 31-05-2013
2 2013-14 01-06-2013 31-05-2014
3 2015-15 01-06-2014 31-05-2015
now your query...
select MONTH(date),YEAR(Date) ,sum(Score),acdyrid,acdyr
from student
left join acdyr on date between acdfromdt and acdtodt
where id='1' and
(MONTH(Date)in (select distinct (MONTH(date)) from student where id='1'))and
(YEAR(Date) in (select distinct (YEAR(date))from student where id='1') )
group by month(date),year(Date);
now in crosstab group by Acdyr column so, result will be...
2012-13 2013-14 2014- 15 ...
6 56
9 3
7 65
8 31
8 51
Happy Coding!
:)