select count( DISTINCT 姓名) ,部门 from 表 group by 部门
select 部门,count(DISTINCT( 姓名))as num from 表名 group by 部门
select distinct 部门,(select count(distinct 姓名) from t t2 where t2.部门=t1.部门)
from t t1
select [部门],[姓名],COUNT([姓名]) FROM [test].[dbo].[Table_1] group by [部门],[姓名]
哟西,select count( distinct 姓名) ,部门 from test group by 部门