select  msi1.segment1                   父件编码,

msi1.description                  父件描述,

msi1.primary_uom_code      父件单位,

msi2.segment1                   子件编码,

msi2.description                  子件描述,

msi2.primary_uom_code      子件单位,

bcb.component_quantity     BOM用量,

bcb.component_yield_factor    产出率,

cos.item_cost                      子件成本

from inv.mtl_system_items_b msi1,

inv.mtl_system_items_b msi2,

bom.bom_structures_b bsb,

bom.bom_components_b bcb,

(select cic.inventory_item_id,

cic.organization_id,

nvl((select max(mc.actual_cost) item_cost

from MTL_CST_ACTUAL_COST_DETAILS mc

where nvl(mc.actual_cost, 0) <> 0

and mc.inventory_item_id = cic.inventory_item_id

and mc.organization_id = cic.organization_id

and exists

(select 'X'

from (select mct.transaction_id,

mct.inventory_item_id,

mct.organization_id,

max(mct.creation_date)

from MTL_CST_ACTUAL_COST_DETAILS mct

where nvl(mct.actual_cost, 0) <> 0

and mct.organization_id = Y

and trunc(mct.creation_date) <=to_date('&DATE_YYYY_MM_DD', 'yyyy-mm-dd')

group by mct.transaction_id,

mct.inventory_item_id,

mct.organization_id) a

where a.transaction_id = mc.transaction_id

and a.inventory_item_id = mc.inventory_item_id

and a.organization_Id = mc.organization_id

and a.transaction_id = mc.transaction_id)

group by 1),

cic.item_cost) item_cost

from bom.cst_item_costs cic

where cic.cost_type_id = 2)cos

where msi1.inventory_item_id = bsb.assembly_item_id

and msi1.organization_id = bsb.organization_id

and msi2.inventory_item_id = bcb.component_item_id

and msi2.organization_id = to_number(bcb.pk2_value)

and bsb.bill_sequence_id = bcb.bill_sequence_id

and bcb.disable_date is null

and msi1.organization_id = Y

and msi2.inventory_item_id = cos.inventory_item_id

and msi2.organization_id = cos.organization_Id

and msi1.segment1 = '&item_number'

Oracle EBS-SQL (CST-1):检查BOM历史成本查询(Average Cost).sql的更多相关文章

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

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

  2. Oracle EBS-SQL (BOM-18):检查BOM与工艺路线对照.sql

    /*有工艺路线,无BOM清单*/ select msi.segment1, msi.description from apps.BOM_OPERATIONAL_ROUTINGS bor, apps.m ...

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

  4. Oracle EBS DBA常用SQL - 安装/补丁【Z】

    Oracle EBS DBA常用SQL - 安装/补丁 检查应用补丁有没有安装:select bug_number,last_update_date from ad_bugs where bug_nu ...

  5. oracle锁表查询,资源占用,连接会话,低效SQL等性能检查

    查询oracle用户名,机器名,锁表对象 select l.session_id sid, s.serial#, l.locked_mode, l.oracle_username, l.os_user ...

  6. [转]oracle EBS 基础100问

    from:http://www.cnblogs.com/xiaoL/p/3593691.html  http://f.dataguru.cn/thread-51057-1-1.html 1001 OR ...

  7. Oracle EBS Model Function Technical

    ♡.Oracle EBS(ERP)Oracle 是公司名字,这个我估计大家都知道.EBS是E-Business Suite的缩写,简单的说,就是Oracle做的一个企业级的信息化软件或者系统,里面包含 ...

  8. Oracle EBS应用笔记整理 (转自IT++ flyingkite)

    ***************************************************** Author: Flyingkite Blog:   http://space.itpub. ...

  9. Oracle EBS R12 (12.1.3) Installation Linux(64 bit)

    Oracle EBS R12 (12.1.3) Installation Linux(64 bit) Contents Objective. 3 1 Download & Unzip. 3 D ...

随机推荐

  1. 网易2014校园招聘杭州Java笔试题

    10) ABC http://soft.chinabyte.com/os/56/12516056.shtml 11) BD. 12) AC. http://blog.sina.com.cn/s/blo ...

  2. js void运用

    谈谈Javascript中的void操作符 http://segmentfault.com/a/1190000000474941 总结: void有如下作用: 通过采用void 0取undefined ...

  3. DropBox与Box的区别,包括直接的投资人的评价(本地Sync可能还是挺重要的)

    作者:曲凯链接:http://www.zhihu.com/question/22207220/answer/20642357来源:知乎著作权归作者所有,转载请联系作者获得授权. Box和Dropbox ...

  4. md5sum.c, md5.c, md5.h

    md5sum.c #include <stdio.h> #include <stdlib.h> #include "md5.h" #pragma warni ...

  5. 微软雅黑 firefox Css 设置 font-family: "microsoft yahei","\5FAE\8F6F\96C5\9ED1","宋体";

    font-family: "microsoft yahei","\5FAE\8F6F\96C5\9ED1","宋体";    // 这里用引 ...

  6. 心急的C小加(两种解法)

    心急的C小加 时间限制:1000 ms  |  内存限制:65535 KB 难度:4   描述 C小加有一些木棒,它们的长度和质量都已经知道,需要一个机器处理这些木棒,机器开启的时候需要耗费一个单位的 ...

  7. HTML标签的offset、client、 scroll和currentStyle属性

    本文来自:http://www.cnblogs.com/quanhai/archive/2010/04/19/1715231.html offsetHeight = borderTopWidth + ...

  8. paip.c++ qt 图片处理 检测损坏的图片

    paip.c++ qt 图片处理 检测损坏的图片 作者Attilax ,  EMAIL:1466519819@qq.com  来源:attilax的专栏 地址:http://blog.csdn.net ...

  9. DAT文件怎样打开

    DAT文件类型主要是"数据"文件.能够是不论什么内容,比方:文字,图形,视频或一般的二进制数据,它并没有统一详细的结构.所以您不能理解它也相应一个用来打开它的应用程序.比方你看到一 ...

  10. c++引擎开发

    MyMap.erase(Itor++); //在windows下也可以Itor = MyMap.erase(Itor),但是在linux下不行. 一个是把指针定为const .就是不能修改指针.也就是 ...