表末添加一列,用来计算前面各列的总和,SQL语句怎么写

如题所述

例如添加列total
alter table 表名
add total int

然后将各列的值刷到total列中
update 表名
set total=列1+列2+列3...
where total is not null
温馨提示:答案为网友推荐,仅供参考
相似回答