LOT NUMBER / PO / RECEIPT NO Relation.
--qa --> po --> receipt no --> rcv --> mmt --> inv lotselect *from --inv itemmtl_material_transactions mmt, mtl_transaction_lot_numbers mtln--rcv trans, rcv_transactions rt, rcv_shipment_headers rsh, rcv_shipment_lines rsl--qa plan, qa_results qrwhere 1=1and mmt.transaction_id = mtln.transaction_idand mmt.organization_id = mtln.organization_id--and mmt.transaction_action_id not in (24, 30)and mmt.organization_id = 122--and mmt.transaction_id =12793270---------------------and mmt.rcv_transaction_id = rt.transaction_idand rsl.shipment_line_id = rt.shipment_line_idand rsh.shipment_header_id = rt.shipment_header_idand rsh.shipment_header_id=rsl.shipment_header_id----------------and rt.qa_collection_id = qr.collection_idand qr.plan_id = 133 -- HKC EPOXY IQC PARENT PLAN--AND (qr.status IS NULL OR qr.status = 2);