Hello All,Can someone tell me what is wrong with my Query?selecta.prid,a.jo,'SCL' as 'Process',a.prdt,isnull(a.model, 'Total'),a.shift,a.bbc,a.sbc,a.input,a.tqty,a.output,a.outvar,a.tyld,a.actyield,a.yvar,a.wipfrom(selectall_prs_id as 'PRID',all_pdt as 'PRDT',all_shf as 'Shift',all_job as 'JO',all_mdl as 'Model',sum(all_bb) as 'Bbc',sum(all_sb) as 'SBC',sum(all_inp_qty) as 'Input',sum(all_tgt_out) as 'TQty',sum(all_out_qty) as 'Output',sum(all_tgt_out) - sum(all_out_qty) as 'OutVar',sum(all_tgt_yld) as 'tyld',((sum(all_out_qty) / sum(all_inp_qty)) * 100) as 'ACTyield',sum(all_tgt_yld) - ((sum(all_out_qty) / sum(all_inp_qty)) * 100) as 'YVar',sum(all_wip) as 'WIP'from con_all_001where all_prs_id = 13 and all_pss = 1group by all_shf, all_mdl, all_pdt, all_job, all_prs_id) awhere a.prdt between '2012-06-17' and '2012-06-17' group by a.model with rollup
I was hoping that it should Group it by Shift since I have Group it on my inner query but it only returns 1 shift.How can I group it by shift?Please help me