Fire a trigger after the update of specific columns in MySQL

You can’t trigger on a particular column update in SQL. It is applied on a row.

You can put your condition for columm in your trigger with an IF statement, as below:

DELIMITER //
CREATE TRIGGER myTrigger AFTER UPDATE ON myTable
FOR EACH ROW
BEGIN
   IF !(NEW.column1 <=> OLD.column1) THEN
      --type your statements here
   END IF;
END;//
DELIMITER ;

Leave a Comment