我的查询是
select m.year_id,Count(*) as Distinctions from NewTestDB.dbo.[Master_MARKS2005] as m
join NewTestDB.dbo.Master_Student as s
on s.Student_id=m.Student_Id
join NewTestDB.dbo.Master_School as sc
on sc.school_id=s.school_code
where sc.SCHOOL_CODE= 'an0001' and m.YEAR_ID between 1 and 8 and m.[NRC_CLASS]='D'
group by m.year_id,
我想要 1 到 8 之间的所有 year_id 但现在我只在 m.[NRC_CLASS]='D'包含“D”值