我有一些桌子。如果我更新st_income列,那么我想更新total_income列,当我这样做时,我想要更新下一列(income_per_person)。我试过这个:
IF (NEW.st_income <> OLD.st_income) THEN
SET NEW.total_income=OLD.total_income + (NEW.st_income-OLD.st_income);
END IF
IF(NEW.total_income <> OLD.total_income) THEN
SET NEW.income_per_person=NEW.total_income/(family_mem_numbers+1)/12;
END IF
但它不起作用。
修改
这是返回消息: