日期:2014-05-18 浏览次数:20589 次
select sys_auserid, sum(case when hy_info_menuid in(7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23) then 1 else 0 end) [搜索任务], sum(case when hy_info_menuid in(24,25,26,27,33,34,35,36,37,38,39,40,41) then 1 else 0 end) [网盟任务], sum(case when hy_info_menuid in(43,45,47,48,49,50,51,52,54,55,56,57,92,96,123) then 1 else 0 end) [流程任务] from hy_Info group by sys_auserid
------解决方案--------------------
select count(*) 搜索任务 from hy_Info where hy_info_menuid in(7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23) group by sys_auserid union select count(*) 网盟任务 from hy_Info where hy_info_menuid in(24,25,26,27,33,34,35,36,37,38,39,40,41) group by sys_auserid union select count(*) 流程任务 from hy_Info where hy_info_menuid in(43,45,47,48,49,50,51,52,54,55,56,57,92,96,123) group by sys_auserid