SELECT PO_DISTRIBUTION_ID,SUM(AMOUNT),SUM(QUANTITY_INVOICED)
FROM AP_INVOICE_DISTRIBUTIONS_ALL
GROUP BY PO_DISTRIBUTION_ID
HAVING PO_DISTRIBUTION_ID IN
(
SELECT DISTINCT(PO_DISTRIBUTION_ID) FROM
AP_INVOICE_DISTRIBUTIONS_ALL
WHERE INVOICE_ID = &INVOICE_ID
)
No comments:
Post a Comment