是否可以动态Add(stage_1 + stage_2)
将其保存到名为total
的列中。我正在使用phpMyAdmin。舞台列的类型为float
。
Car stage_1 stage_2 total 1 30 50 80 2 28 51 79 3 31 51 82
提前感谢您的帮助。
答案 0 :(得分:1)
试试这个:
update cartable set total = stage_1 + stage_2
实际上,您可以只创建一个视图,而不是将列总数存储在数据库中:
create view carview as
select Car, state_1, stage_2, stage_1 + stage_2 as total
from cartable