sql简单的问题~~
两个表(tab1,tab2)中都有num(int类型)列...现在想把两个的num相加并放到第三
tab3的AllNum中要怎么写?
------解决方案--------------------insert into tab3
select a.num + b.num
from tab1 a inner join tab2 on a.id = b.id
------解决方案--------------------insert into tab3 (allnum) select tab1.num+tab2.num from tab1 inner join tab2 on tab1.id=tab2.id