问一个sql语句解决方案

问一个sql语句现在从一个xml中更新数据UPDATE tb SET set aa+@a , bb+@b ,c(a+@a)/(b+@b)FROM #table A

问一个sql语句
现在从一个xml中更新数据

UPDATE tb SET set a=a+@a , b=b+@b ,c=(a+@a)/(b+@b) FROM #table AS e 
WHERE e.d = d and e.e=@e;


如果没有 满足 d和 e 怎么实现
insert into tb (a,b,c,d,e) values (@a,@b,@c.@d,@e) 呢



[解决办法]
if not exists(select 1 from #tabel where d = @d and e = @e)
insert into tb (a,b,c,d,e) values (@a,@b,@c.@d,@e)
else
update ...
[解决办法]
貌似可以IF else先判断