SELECT company_name,cp_province,cp_city,cp_area,worktype_name,SUM(allpass) as allCount FROM [dbo].[Ex_PersonExam]
WHERE allpass=1 GROUP BY company_name,cp_province,worktype_name, cp_city,cp_area
SELECT company_name,cp_province,cp_city,cp_area,worktype_name,SUM(allpass) as allCount FROM [dbo].[Ex_PersonExam]
WHERE allpass=1 GROUP BY company_name,cp_province,worktype_name, cp_city,cp_area