merge into t_sysprobe_info d using(select count(*) co from t_sysprobe_info where pk_sysprobe_info='aeth1301645916954') s on (s.co <>0)
  when matched then
    update set d.current_version='1.0000.RC' ,d.upgrade_version='2.0000.RC',d.upgrade_flag='ok' where d.pk_sysprobe_info='beth1301645916954'
when not matched then
insert (d.pk_sysprobe_info,d.current_version,d.upgrade_version,d.upgrade_flag) values ('aeth1301645916954','1.0000.RC','2.0000.RC','ok')头一回学习这种SQL语句的写法,用了when matched then 的语句,相当于if-else.
标记下,以免后续用到时可以找,呵呵~~~