SELECT hou.name,--组织 aia.invoice_num,--发票编号 msib.segment1,--物料编码 mmt.transaction_id--物料事务处理 FROM mtl_material_transactions mmt, apps.cst_ap_variance_headers cph, (SELECT DISTINCT cpl.variance_header_id, cpl.po_distribution_id, cpl.invoice_id FROM apps.cst_ap_variance_lines cpl) cpl, apps.ap_invoices_all aia, hr_operating_units hou, mtl_system_items_b msib WHERE mmt.transaction_type_id = 80 AND mmt.source_code = 'VARIANCE TRF' AND mmt.transaction_reference LIKE 'PO Distribution%' AND cph.variance_header_id = mmt.source_line_id AND cph.variance_header_id = cpl.variance_header_id AND aia.invoice_id = cpl.invoice_id AND aia.org_id = hou.organization_id AND msib.inventory_item_id = mmt.inventory_item_id AND msib.organization_id = mmt.organization_id