日期:2014-05-17  浏览次数:20757 次

update from 的问题
update CsoKPIBase a set F_ASPNodeTotalCsoQty = (select count(Key) as sum_qty, ASPNode from CsoKPIBase
  where 
  ServiceType<> 9 
  and ServiceType<> 11 
  and ServiceType<> 12 
  and  InternalCloseTime >= to_date('2012-01-01 00:00:00', 'yyyy-mm-dd hh24:mi:ss') 
  and InternalCloseTime <= to_date('2012-12-12 23:59:59', 'yyyy-mm-dd hh24:mi:ss') group by ASPNode)b
  where a.ASPNode=b.ASPNode

应该怎么改啊?我这样写报错,求高手指导

------解决方案--------------------

update CsoKPIBase a set F_ASPNodeTotalCsoQty = (select count(Key) as sum_qty from CsoKPIBase c
   where 
   c.ServiceType<> 9 
   and c.ServiceType<> 11 
   and c.ServiceType<> 12 
   and  c.InternalCloseTime >= to_date('2012-01-01 00:00:00', 'yyyy-mm-dd hh24:mi:ss') 
   and c.InternalCloseTime <= to_date('2012-12-12 23:59:59', 'yyyy-mm-dd hh24:mi:ss')
   and c.ASPNode=a.ASPNode
   group by ASPNode   
   )b 

要是CsoKPIBase 查不到a.ASPNode 会 更新成空值的哦