Hi,
I am working on some SQL code for a report and from the code that i am copying in below i am getting back four lines. i know i am only supposed to be getting back two lines but can't see where the missing link it. Hopefully someone can help me.
thanks in advance for help.
greatly appreciated
lasd
SELECT PH.po_header_id C_PO_HEADER_ID,
PH.segment1 C_PO_NUM,
PH.rate C_RATE,
PH.creation_date C_CREATION_DATE,
PR.release_num C_PO_RELEASE_NUM,
PL.line_num C_PO_LINE_NUM,
PLL.shipment_num C_PO_SHIPMENT_NUM,
PD.distribution_num C_PO_DISTRIBUTION_NUM,
PD.quantity_ordered C_QUANTITY_ORDERED,
RSH.receipt_num C_RECEIPT_NUM3,
RSL.Quantity_received C_QUANTITY_RECEIVED3
FROM po_headers_all PH,
po_lines_all PL,
po_line_locations_all PLL,
po_distributions_all PD,
po_releases_all PR,
rcv_transactions RTXN,
rcv_shipment_headers RSH,
rcv_shipment_lines RSL
WHERE PH.po_header_id = PD.po_header_id
AND PD.line_location_id = PLL.line_location_id
AND PLL.po_line_id = PL.po_line_id
AND PD.po_header_id = PR.po_header_id (+)
AND RTXN.PO_DISTRIBUTION_ID=PD.PO_DISTRIBUTION_ID
AND RTXN.PO_LINE_ID=PL.PO_LINE_ID
AND RTXN.PO_LINE_LOCATION_ID=PLL.line_location_id
AND PH.po_header_id=RTXN.PO_HEADER_ID
AND RTXN.shipment_line_id=RSL.shipment_line_id
AND RSL.shipment_header_id=RSH.shipment_header_id
AND PH.SEGMENT1='182386'
I am working on some SQL code for a report and from the code that i am copying in below i am getting back four lines. i know i am only supposed to be getting back two lines but can't see where the missing link it. Hopefully someone can help me.
thanks in advance for help.
greatly appreciated
lasd
SELECT PH.po_header_id C_PO_HEADER_ID,
PH.segment1 C_PO_NUM,
PH.rate C_RATE,
PH.creation_date C_CREATION_DATE,
PR.release_num C_PO_RELEASE_NUM,
PL.line_num C_PO_LINE_NUM,
PLL.shipment_num C_PO_SHIPMENT_NUM,
PD.distribution_num C_PO_DISTRIBUTION_NUM,
PD.quantity_ordered C_QUANTITY_ORDERED,
RSH.receipt_num C_RECEIPT_NUM3,
RSL.Quantity_received C_QUANTITY_RECEIVED3
FROM po_headers_all PH,
po_lines_all PL,
po_line_locations_all PLL,
po_distributions_all PD,
po_releases_all PR,
rcv_transactions RTXN,
rcv_shipment_headers RSH,
rcv_shipment_lines RSL
WHERE PH.po_header_id = PD.po_header_id
AND PD.line_location_id = PLL.line_location_id
AND PLL.po_line_id = PL.po_line_id
AND PD.po_header_id = PR.po_header_id (+)
AND RTXN.PO_DISTRIBUTION_ID=PD.PO_DISTRIBUTION_ID
AND RTXN.PO_LINE_ID=PL.PO_LINE_ID
AND RTXN.PO_LINE_LOCATION_ID=PLL.line_location_id
AND PH.po_header_id=RTXN.PO_HEADER_ID
AND RTXN.shipment_line_id=RSL.shipment_line_id
AND RSL.shipment_header_id=RSH.shipment_header_id
AND PH.SEGMENT1='182386'