subquery min limitation
Hello all,
This query is going to be a subquery in the From statement. I need the additional fields for my end query Where statements. Would someone help me understand why I do not get a single row like I expect? There are 3 distributions total, 2 with the line_type_lookup_code of ITEM. I get the two rows returned.
SELECT MIN(apd1.invoice_distribution_id) invoice_distribution_id ,
apd1.po_distribution_id,
apd1.attribute1
FROM ap_invoice_distributions_all apd1
WHERE apd1.line_type_lookup_code = 'ITEM'
and apd1.attribute1 = '20024'
GROUP BY apd1.attribute1,
apd1.invoice_distribution_id,
This query is going to be a subquery in the From statement. I need the additional fields for my end query Where statements. Would someone help me understand why I do not get a single row like I expect? There are 3 distributions total, 2 with the line_type_lookup_code of ITEM. I get the two rows returned.
SELECT MIN(apd1.invoice_distribution_id) invoice_distribution_id ,
apd1.po_distribution_id,
apd1.attribute1
FROM ap_invoice_distributions_all apd1
WHERE apd1.line_type_lookup_code = 'ITEM'
and apd1.attribute1 = '20024'
GROUP BY apd1.attribute1,
apd1.invoice_distribution_id,
0