Hello AllPlease Help me again this one.I`am trying to query the details of a Model per process.Basically each Big book has one model and 18 small books.I want to show the data like the one below.---------|---------|-----------------|-------|----------------|------------------|Sequence | Process | Production Date | Model | Big book Count | Small Book Count |---------|---------|-----------------|-------|----------------|------------------|1 | Cutting | 2012-01-30 | GSX1 | 3 | 54 |
But using my query it gives me this result.---------|---------|-----------------|-------|----------------|------------------|Sequence | Process | Production Date | Model | Big book Count | Small Book Count |---------|---------|-----------------|-------|----------------|------------------|1 | Cutting | 2012-01-30 | GSX1 | 3 | 12 |
Can you please tell me what is wrong with my query?Please Check.selectx.Sequence as 'Sequence',x.Process as 'Process',x.pdt as 'Production Date',x.mdl as 'Model',count(x.bigbook) as 'Bigbook Count',max(x.sb) as 'Smallbook'from(select distinct'1' as 'Sequence','Cutting' as 'Process',cut_pdt as 'PDT',cut_shf as 'Shift',cut_mdl as 'Mdl',cut_bbn as 'Bigbook', count(cut_sbn) as 'SB', sum(cut_inp_qty) as 'Input', sum(cut_out_qty) as 'Output', sum(cut_ng_qty) as 'NG'from sum_cut_001 group by cut_bbn) xgroup by x.mdl
Thank you in advance.