語法, 如下 :
語法
SELECT RT.TRANSACTION_DATE
, RT.QUANTITY
FROM OE_ORDER_HEADERS_ALL OOH
, OE_ORDER_LINES_ALL OOL
, RCV_SHIPMENT_LINES RSL
, RCV_TRANSACTIONS RT
WHERE OOH.HEADER_ID = OOL.HEADER_ID
AND OOL.LINE_ID = RSL.OE_ORDER_LINE_ID
AND RSL.SHIPMENT_LINE_ID = RT.SHIPMENT_LINE_ID
AND OOL.ORG_ID = &ORG_ID
AND OOL.INVENTORY_ITEM_ID = &INVENTORY_ITEM_ID
AND OOL.FLOW_STATUS_CODE <> 'CANCELLED'
AND RSL.QUANTITY_RECEIVED <> 0
AND RT.TRANSACTION_DATE BETWEEN TO_DATE('&START_DATE','YYYYMMDD') and (TO_DATE('&END_DATE','YYYYMMDD')+ 1)
AND RT.TRANSACTION_TYPE = 'DELIVER'
AND RT.SOURCE_DOCUMENT_CODE = 'RMA';