|
-
If this helps. Here is the SQL:
SELECT flum.vend_name vendorname, MAX (flum.gmm) gmm,
MAX (flum.fob) fob, flum.dept dept, MAX (flum.TYPE) TYPE,
MAX (DECODE (flum.reason,
'0013', '0003',
'0014', '0003',
'0098', '0004',
'0082', '0008',
flum.reason
)
) reason,
SUM (flum.units) targetunits, flum.pid pid,
MAX (flum.item_desc) item_desc,
DECODE (MAX (DECODE (flum.reason,
'0013', '0003',
'0014', '0003',
'0098', '0004',
'0082', '0008',
flum.reason
)
),
'0001', 1,
'0012', 2,
'0002', 3,
'0003', 4,
'0004', 5,
'0005', 6,
'0006', 7,
'0008', 8,
'0010', 9,
999
) AS ordercol
FROM fl3_wp_det flum,
div_fob_43 div,
line_rate_43 line,
work_type_desc des,
fbil_rank fbil
WHERE div.div = flum.div
AND div.fob = flum.fob
AND des.TYPE = flum.TYPE
AND des.work_type = line.work_type
AND line.line = div.line
AND flum.div = 20
AND flum.div = fbil.div_nbr
AND flum.STORE = fbil.store_nbr
AND fbil.RANK <> 'F'
AND flum.STORE = 10
AND TRUNC (flum.effective_date) = TO_DATE ('01/30/2006', 'MM/DD/YYYY')
AND flum.TYPE = 'PCS'
AND flum.reason = '0001'
AND DECODE (flum.TYPE, 'PCS', flum.reason, ' ') = des.reason
AND flum.fob IN (81)
GROUP BY flum.pid, flum.dept, flum.vend_name
ORDER BY gmm, fob, flum.dept, ordercol, flum.vend_name, flum.pid;
I appreciate your help.
DBA01
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|