首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > oracle >

update from 的有关问题

2013-01-11 
update from 的问题update CsoKPIBase a set F_ASPNodeTotalCsoQty (select count(Key) as sum_qty, ASP

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 会 更新成空值的哦

热点排行