select id,name,isnull(sum(work),0) as work from 表 group by id,name
SELECT id,name,isnull(sum(work),0) AS work FROM 表 GROUP BY name
select DISTINCT id,name,isnull(sum(work),0) as work from table group by id,name
用SQL可以实现!
SELECT name,sum(work) as worksum FROM 表名 GROUP BY name
如果还想按work的数据排序
SELECT name,sum(work) as worksum FROM 表名 GROUP BY name ORDER BY worksum
dasdf