Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1793263
  • 博文数量: 334
  • 博客积分: 11301
  • 博客等级: 上将
  • 技术积分: 3452
  • 用 户 组: 普通用户
  • 注册时间: 2006-10-18 10:19
个人简介

路虽弥,不行不至;事虽少,不做不成。

文章分类

全部博文(334)

文章存档

2013年(4)

2012年(19)

2011年(27)

2010年(71)

2009年(45)

2008年(15)

2007年(84)

2006年(69)

分类: Oracle

2008-12-02 16:49:56

=====================================SQL Scripts==============================

SELECT   round (SUM (cpc.accounted_value), 2) accounted_value,
         round (SUM (cpc.accounted_onhand_value), 2) accounted_onhand_value,
         round (SUM (cpc.rollback_onhand_value), 2) rollback_onhand_value,
         round (SUM (cpc.onhand_value_discrepancy), 2) discrepancy,
         msi.segment1, cpc.organization_id,oap.period_name
    FROM inv.org_acct_periods oap,
         bom.cst_period_close_summary cpc,
         inv.mtl_system_items_b msi
   WHERE oap.organization_id = cpc.organization_id
     AND oap.acct_period_id = cpc.acct_period_id
     AND oap.period_name = 'NOV-08'
     AND msi.organization_id = &org_id
     AND msi.inventory_item_id = cpc.inventory_item_id
  HAVING TRUNC (SUM (cpc.onhand_value_discrepancy), 2) > 1
      OR TRUNC (SUM (cpc.onhand_value_discrepancy), 2) < -1
GROUP BY msi.segment1, cpc.organization_id,oap.period_name
阅读(1884) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~