SELECT --mst.organization_id,DESCRIPTION
msi.segment1,
msi.description,
msi.primary_uom_code,
-- cct.cost_type,
round(nvl(cic.item_cost,0),5) item_cost,
round(nvl(cic.material_cost,0),5) material_cost,
round(nvl(cic.material_overhead_cost,0),5) material_overhead_cost,
round(nvl(cic.resource_cost,0),5) resource_cost,
round(nvl(cic.outside_processing_cost,0),5) outside_procession_cost,
round(nvl(cic.overhead_cost,0),5) overhead_cost
-- cic.lot_size,
-- cic.based_on_rollup_flag,
-- cic.defaulted_flag
FROM inv.mtl_system_items msi,
bom.cst_item_costs cic,
bom.cst_cost_types cct
WHERE msi.organization_id = cic.organization_id
AND msi.inventory_item_id = cic.inventory_item_id
AND cic.cost_type_id = cct.cost_type_id
--Filter
AND msi.organization_id =255
--AND mst.segment1 LIKE '9%'
AND cct.cost_type = '平均'
AND UPPER(MSI.inventory_ITEM_status_CODE)='ACTIVE'
msi.segment1,
msi.description,
msi.primary_uom_code,
-- cct.cost_type,
round(nvl(cic.item_cost,0),5) item_cost,
round(nvl(cic.material_cost,0),5) material_cost,
round(nvl(cic.material_overhead_cost,0),5) material_overhead_cost,
round(nvl(cic.resource_cost,0),5) resource_cost,
round(nvl(cic.outside_processing_cost,0),5) outside_procession_cost,
round(nvl(cic.overhead_cost,0),5) overhead_cost
-- cic.lot_size,
-- cic.based_on_rollup_flag,
-- cic.defaulted_flag
FROM inv.mtl_system_items msi,
bom.cst_item_costs cic,
bom.cst_cost_types cct
WHERE msi.organization_id = cic.organization_id
AND msi.inventory_item_id = cic.inventory_item_id
AND cic.cost_type_id = cct.cost_type_id
--Filter
AND msi.organization_id =255
--AND mst.segment1 LIKE '9%'
AND cct.cost_type = '平均'
AND UPPER(MSI.inventory_ITEM_status_CODE)='ACTIVE'
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/12122734/viewspace-462709/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/12122734/viewspace-462709/
本文提供了一个SQL查询示例,用于从特定的组织ID中获取活动状态的库存项目的成本数据,包括物料成本、资源成本等,并展示了如何通过SQL语句进行精确的数据筛选。
248

被折叠的 条评论
为什么被折叠?



