不要用下列代码给我
我要的是对字段操作,不要对数据操作
- SQL code
with web_wlms_o4sequence_user(cod_mitem, rot_ord, plan_wkhr_m, plan_wkhr_no, status)as ( select 'Z12009-M01', 01, '10.000', 7, '01' from dualunion all select 'Z12009-M01', 14, '20.000', 13, '01' from dualunion all select 'Z12009-M01', 15, '20.000', 3, '02' from dualunion all select 'Z12009-M01', 15, '20.000', 2, '00' from dualunion all select 'Z12009-M01', 15, '20.000', 2, '01' from dualunion all select 'Z12009-M01', 15, '20.000', 6, '01' from dual)select cod_mitem 工程机号, rot_ord 工程令次, plan_wkhr_m 令次分配工时,sum(plan_wkhr_no) 令次总派工时,sum(decode(status, '00', plan_wkhr_no)) 审核中工时,sum(decode(status, '01', plan_wkhr_no)) 审核通过,sum(decode(status, '02', plan_wkhr_no)) 退审工时from web_wlms_o4sequence_user group by cod_mitem, rot_ord, plan_wkhr_morder by 1,2,3;
------解决方案--------------------