update多个字段的写法

第一种写法:update a set (c1,c2,c3) =(select c1,c2,c3 from b where......) where ......;

第二种写法比较笨:update test set a= '11 ',b = '22 ' where id=1


例如:update  omcw_owner.MR_RULE_RECORD
   set alarm_rule='1月 至 12月: 年度计划 -2 <= 指标值 < 年度计划',warm_rule='1月 至 12月: 指标值 < 年度计划 -2'
    where alarm_rule='1月 至 12月: 年度计划 - -2 <= 指标值 < 年度计划' and warm_rule='1月 至 12月: 指标值 < 年度计划 - -2';

posted @ 2015-06-01 00:38  明月镇魂  阅读(1786)  评论(0编辑  收藏  举报