日期:2014-05-19  浏览次数:20526 次

关于字段相加的问题
有一个表
字段为:a1   a2   a3
数据:     a     b    
                c     d        
我现在想写一条插入语句,想让a3=a1+a2

结果应该是:
a1   a2   a3
a     b     ab
c     d     cd  


改怎么写?


------解决方案--------------------
select a1, a2 ,a3 = isnull(a1, ' ') + isnull(a2, ' ') from table
------解决方案--------------------
update 表名 set a3=a1+a2