mysql 在我的user表中 有字段 A 、字段B、字段C;当我更新字段A 或者B时 如何的更新字段的C的值
2025-03-05 04:36:54
推荐回答(3个)
回答1:
不需要触发器,使用计算列 建表语句 create table xxx ( a int not null, b int not null, c as a+b ) insert into sss values (1,2) update xxx set a =2 where a=1 select * from sss 测试通过