SELECT
'零成本交易' 交易异常类型 ,msi.segment1 项目 ,msi.DESCRIPTION 描述 ,mmt.subinventory_code 子库 ,mil1.segment1 货位 ,mmt.transaction_quantity 事务数量 ,mmt.actual_cost 事务成本 ,mmt.transaction_uom 单位 ,mmt.transaction_date 事务日期 ,mtt.transaction_type_name 事务类型 ,stp.transaction_source_type_name 事务来源 FROM inv.mtl_material_transactions mmt ,inv.mtl_system_items_b msi ,inv.mtl_item_locations mil1 ,inv.mtl_transaction_types mtt ,inv.mtl_txn_source_types stpWHERE mmt.Inventory_Item_Id = msi.Inventory_Item_IdAND mmt.Organization_Id = X
AND mmt.Organization_Id = msi.Organization_Id AND mil1.Inventory_Location_Id(+) = mmt.locator_id AND mil1.Organization_Id(+) = mmt.Organization_Id AND stp.transaction_source_type_id = mmt.transaction_source_type_id AND mtt.transaction_type_id = mmt.transaction_type_id AND MMT.TRANSACTION_DATE >=TO_DATE('20**-01-15','YYYY-MM-DD') AND mmt.actual_cost = 0--and msi.segment1 not like '100%'