ITPub博客

首页 > Linux操作系统 > Linux操作系统 > Sql

Sql

原创 Linux操作系统 作者:lmainxie 时间:2009-11-24 15:12:05 0 删除 编辑
SELECT DISTINCT mp.organization_code org, mmt.attribute15 slip_num,
                mmt.subinventory_code from_sub,
                mmt.transfer_subinventory to_sub, msi.segment1 partno,
                msi.mrp_planning_code mrp_code, msi.planner_code mc_code,
                SUBSTRB (mpl.description, 1, 16) mc_name,
                SUBSTRB (msi.description, 1, 30) description,
                mmt.transaction_date transaction_date,
                mmt.transaction_quantity quantity, mmt.prior_cost qty_price,
                mmt.primary_quantity * mmt.prior_cost amt
           FROM mtl_material_transactions mmt,
                mtl_system_items msi,
                mtl_planners mpl,
                mtl_parameters mp
          WHERE mmt.organization_id = '&1'
            AND transaction_quantity < 0
 AND TRUNC (mmt.transaction_date) BETWEEN TO_DATE ('&2','yyyy/mm/dd')
                                      AND TO_DATE ('&3','yyyy/mm/dd')
            AND ((mmt.subinventory_code = UPPER ('&4')) OR ('&4' IS NULL))
            --AND ((MMT.TRANSFER_SUBINVENTORY='&6') OR ('&6' IS NULL))
            AND mmt.attribute15 LIKE UPPER ('&5') || '%'
            AND msi.planner_code = mpl.planner_code(+)
            AND mmt.organization_id = mp.organization_id
            AND mmt.organization_id = msi.organization_id
            AND mmt.inventory_item_id = msi.inventory_item_id

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/10434717/viewspace-620401/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2007-12-29

  • 博文量
    23
  • 访问量
    49548