I have to count all the teachers whose ages are going to be 60 at June 2013, June 2014 and June 2015. Details : at 2013 there is one teacher 2014 there is 5 teachers same etc.
I don't know how to get the three next years with June and count the number of teachers whose age will be 60 at June 2013, June 2014 and June 2015.
Here is the table:
TeacherName DateOfBirth TeacherAge june2013 june2014 june2015
S. KHALID SALIM 1958-03-23 00:00:00.000 55
ZUBAIDA BEGUM 1976-08-01 00:00:00.000 36
TANZEEM AKHTAR 1974-09-25 00:00:00.000 38
MARYAM BIBI 1982-08-18 00:00:00.000 30
RABIA TABASSUM 1976-11-10 00:00:00.000 36
Here is my query:
SELECT TeacherName, DateOfBirth,
datediff(mm, DateOfBirth, getdate()) / 12 as TeacherAge,
'' as june2013(countteachers) , '' as june2014(countteachers), '' as june2015(countteachersonlywhoseagewillbe60atjune2015)
FROM Teachers