Can I create trigger after the update of specific columns in MySQL?
Answers (1)
Add AnswerYou can’t trigger on a particular column update in SQL. It is applied on a row.
You can put condition for column in your trigger with an IF
statement, as below:
CREATE TRIGGER myTrigger AFTER UPDATE ON employeeTable
FOR EACH ROW
BEGIN
IF !(NEW.column1 <=> OLD.column1) THEN
–your statements here
END IF;
END;