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. HTML+CSS学习

    1.彻底弄懂CSS盒子模式(DIV布局快速入门) 2.在CSS中,BOX的Padding属性的数值赋予顺序为padding:10px; 四个内边距都是10px padding:5px 10px; 上下 ...

  2. 2015年阿里巴巴蚂蚁金服校招JAVA研发工程师内推电话面试

    没想到阿里校招如此之早,虽然早已进入复习备战状态,但还是感觉有些措手不及...找了个在蚂蚁金服做HR的同学帮忙了内推,然后在最近的几天匆匆忙忙地复习JAVA(之前都把精力放在了数据结构.算法等基础上了 ...

  3. BZOJ 3529 数表(莫比乌斯反演)

    http://www.lydsy.com/JudgeOnline/problem.php?id=3529 思路:令F(i)为i的约数和, 1<=x<=n,1<=y<=m G(i ...

  4. Android Studio参考在线文章

    This article is From :http://www.android-studio.org/index.php/docs/guide Gradle使用手册(一):为什么要用Gradle? ...

  5. c语言中内存对齐问题

    在最近的项目中,我们涉及到了“内存对齐”技术.对于大部分程序员来说,“内存对齐”对他们来说都应该是“透明的”.“内存对齐”应该是编译器的“管辖范围”.编译器为程序中的每个“数据单元”安排在适当的位置上 ...

  6. Plus One 解答

    Question Given a non-negative number represented as an array of digits, plus one to the number. The ...

  7. GDB+GDBServer调试Linux应用程序

    参考:http://blog.csdn.net/shanghaiqianlun/article/details/7820401 一.gdb+gdbserver总体介绍 远程调试环境由宿主机GDB和目标 ...

  8. 让magento的validate验证hidden field

    Object.extend(Validation, { isVisible : function(elm) { return true; }, insertAdvice : function(elm, ...

  9. IOS 调用系统发邮件Api

    // 判断设备是否有发送邮件功能 NSString *deviceType = [UIDevice currentDevice].model; if([deviceType isEqualToStri ...

  10. 性能优化之Hibernate缓存讲解、应用和调优

    JavaMelody——一款性能监控.调优工具, 通过它让我觉得项目优化是看得见摸得着的,优化有了针对性.而无论是对于分布式,还是非分布,缓存是提示性能的有效工具. 数据层是EJB3.0实现的,而EJ ...