Is this table B
I want to put the table B field xiaofei summation. The filter is user and dianhua
After get the sum of values, automatic updates to the table A filter user and dianhua to z_xiaofei field.
As long as there is update, or delete data. Table B is automated
CodePudding user response:
The update kh_list kl, (select sum (xiaofei) z_xiaofei, ` user `, dianhua from kh_yc GROUP BY ` user `, dianhua) ky
The set kl. Z_xiaofei=ky. Z_xiaofei
Where kl. ` user `=ky. ` user ` and kl. Dianhua=ky. Dianhua
CodePudding user response:
Write a triggerCodePudding user response:
Excuse me maple VS mark eldest brother, if this in navicat, should be to create a new event? Or function?