you just need thisselect COUNT(*) [Student_Count] , avg([Scale Score])[Scale Score] ,COUNT(case when [Level 2 (Satisfactory) Initial] = '1' then 1 end) * 100.0/COUNT(*) as [Level 2 Initial],COUNT(case when [Level 2 (Satisfactory)] = '1' then 1 end) * 100.0/COUNT(*) as [Level 2 (Satisfactory)],COUNT(case when [Commended Advanced] = '1' then 1 end) * 100.0/COUNT(*) as [Commended Advanced],COUNT(case when [Level 2 (Satisfactory) Initial] = '1' then 1 end) * 100.0/COUNT(*) as [Level 2 Initial] where exists ( select * from staar where [Gender (DF)] = 'Female')from Staar WHERE [Gender (DF)] = 'Female'
------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/