In the following t-sql 2012, I want to select records from the AMilestone table when
the schoolyear is the most current year from the ASemester table.
select *
from ASemester ASemester
join AMilestone AMilestone
on AMilestone.SCHOOLYEAR = ASemester.SCHOOLYEAR
where ASemester.SCHOOLYEAR = ASemester.max(SCHOOLYEAR)
The sql listed above does not work. Thus would you show me the t-sql on how to solve my problem?