财务审计商业智能分析

运筹规划

博客园 首页 新随笔 联系 管理

update vtronstaging.dbo.fact_t_purchasing
set 通知数量 = 0, 通知单号 =0  where 通知单ID is null

update vtronstaging.dbo.fact_t_purchasing
set 实际入库数量 = 0, 实际入库单价 = 0, 实际入库金额 = 0, 入库单号 = 0, 入库日期 = '01/01/2049' where 入库单ID is null


update vtronstaging.dbo.fact_t_purchasing
set 订货数量 = 0 , 采购金额 = 0
from vtronstaging.dbo.fact_t_purchasing t1
where [入库单号] <>
  (
 select top 1 [入库单号]
 from vtronstaging.dbo.fact_t_purchasing t2
 where t1.采购单ID = t2.采购单ID and t1.采购单分录ID = t2.采购单分录ID
 order by [入库单号] desc
  )

posted on 2006-07-24 12:52  春申  阅读(446)  评论(0编辑  收藏  举报