select
         e.FULL_NAME                                                     采购员,
         sum(plla.quantity-plla.QUANTITY_CANCELLED)  订购数量,
         sum(plla.Quantity_Received)                           完成数量 ,
         round(SUM(plla.Quantity_Received)*100 / sum(plla.quantity-plla.QUANTITY_CANCELLED),2)||'%' 完成百分比
FROM
         PO.PO_AGENTS                       pa,
         PO.PO_HEADERS_ALL             pha,
         PO.PO_LINES_ALL                   pla,
         PO.PO_LINE_LOCATIONS_ALL plla,
         PO.PO_VENDORS                     pv,
         hr.PER_ALL_PEOPLE_F               e,
         inv.mtl_system_items_b         msi
where
         pha.org_id = X
 and ((pha.PO_HEADER_ID = pla.PO_HEADER_ID)
 and (pla.PO_LINE_ID=plla.PO_LINE_ID) 
 and (pha.AGENT_ID=pa.AGENT_ID)
 and (pha.ORG_ID=pla.ORG_ID)
 and (msi.inventory_item_id = pla.item_id)
 and (msi.organization_id in (X,Y))
 and (msi.organization_id = plla.ship_to_organization_id)
 and (pha.VENDOR_ID=pv.VENDOR_ID)
 and (pha.agent_id=E.PERSON_ID(+)))
 and nvl(pha.APPROVED_FLAG,'N') = 'Y'
 and nvl(plla.APPROVED_FLAG,'N') ='Y'
 and nvl(pha.CANCEL_FLAG,'N') ='N'
 and nvl(pla.CANCEL_FLAG,'N') ='N'
 and nvl(plla.CANCEL_FLAG,'N') = 'N'
 and pha.type_lookup_code = 'STANDARD'
 and nvl(plla.need_by_date,plla.promised_date) between
     to_date('20**-01-01','YYYY-MM-DD') AND to_date('20**-01-31','YYYY-MM-DD')
group by
     e.full_name

Oracle EBS-SQL (PO-16):检查采购订单完成情况统计.sql的更多相关文章

  1. Oracle EBS-SQL (PO-9):检查期间采购订单执行情况.sql

    --采购订单执行情况查询(七天内接收情况)select pha.segment1       采购订单,         msib.segment1      物料编码,         pla.qu ...

  2. Oracle EBS中分类账和法人实体 的关系(有sql语句实例)

    Oracle EBS中分类账和法人实体 的关系(有sql语句实例) 2012-12-06 16:05 2822人阅读 评论(0) 收藏 举报  分类: Oracle EBS(12)  Oracle数据 ...

  3. oracle ebs 采购订单关闭之PL/SQL实现方法

    应客户需求,需要写个脚本,批量关闭Bonus Item类型的采购订单,在metalink上搜索到一些方法,但是都测试不通.原来需要将代码生成一个并发程序.下面是测试成功的代码. 1.首先创建一个存储过 ...

  4. Oracle EBS-SQL (PO-5):采购订单控制信息查询.sql

    select distinct pla.po_header_id, --pha.type_lookup_code, pha.segment1       采购订单号, appf.full_name   ...

  5. Oracle EBS-SQL (PO-11):检查采购订单退货数.sql

    select msi.segment1                                    物料编码,     --  msi.inventory_item_id return_it ...

  6. Oracle EBS-SQL (PO-4):检查采购订单明细.sql

    SELECT PHA.SEGMENT1                  订单号, pha.approved_flag           批准状态, pha.closed_code        订 ...

  7. PO*创建标准采购订单

    --   l_iface_rec       po_headers_interface%ROWTYPE; 校验头相关信息 ) INTO l_po_count FROM po_headers_all p ...

  8. Oracle EBS OM 已存在的OM订单增加物料

    DECLARE l_header_rec OE_ORDER_PUB.Header_Rec_Type; l_line_tbl OE_ORDER_PUB.Line_Tbl_Type; l_action_r ...

  9. Oracle EBS 隐藏帮助-诊断-检查

随机推荐

  1. information_schema.engines学习

    当前mysql实例的存储引擎信息可以从information_schema.engines 中查询到 例子: mysql> select * from information_schema.en ...

  2. 实现AT24C02的数据读写操作

    /*************************************************************** 功能:11:32 2008-6-27 作者:SG 时间:2004-03 ...

  3. WIN下和LINUX动态库的区别

    **************************************************************************************************** ...

  4. UVA_Digit Puzzle UVA 12107

    If you hide some digits in an integer equation, you create a digit puzzle. The figure below shows tw ...

  5. 【转】morgan stanley 电面面经新鲜出炉

    楼楼早上上午大概11点接到的电话,一个声音炒鸡好听的GG,说他是来自morgan stanley的,想和我约一下店面时间.我一听,真是戳不及防,掐指一算,online的IKE测试已经过去20几天了吧, ...

  6. 【LeetCode练习题】Minimum Path Sum

    Minimum Path Sum Given a m x n grid filled with non-negative numbers, find a path from top left to b ...

  7. 一起来学canvas (前言)

    codeyy - 一依丫丫 一起来学canvas (前言)

  8. poj 2115 C Looooops(推公式+扩展欧几里得模板)

    Description A Compiler Mystery: We are given a C-language style for loop of type for (variable = A; ...

  9. poj 3311 Hie with the Pie(状态压缩dp)

    Description The Pizazz Pizzeria prides itself or more (up to ) orders to be processed before he star ...

  10. poj 3370 Halloween treats(鸽巢原理)

    Description Every year there is the same problem at Halloween: Each neighbour is only willing to giv ...