日期:2014-05-17 浏览次数:20957 次
select 责任人,事业部, 问题类别,对应系统 from Your_table order by 责任人;
------解决方案--------------------
select t.责任人,sum(t.事业部),sum(t.问题类别),sum(t.对应系统
) from tablename t where t.dyxt='DMS'
UNION ALL
select t.责任人,sum(t.事业部),sum(t.问题类别),sum(t.对应系统
) from tablename t where t.dyxt='合格证'
UNION ALL
select t.责任人,sum(t.事业部),sum(t.问题类别),sum(t.对应系统
) from tablename t where t.dyxt='其他'
------解决方案--------------------
--或者: select 责任人,事业部,count(*) from Your_table group by 责任人,事业部;
------解决方案--------------------