CREATE TRIGGER trigger_name { BEFORE | AFTER } { INSERT | UPDATE | DELETE } ON table_name
FOR EACH ROW
BEGIN
// Statement
// new.col_name
// old.col_name
END
DROP TRIGGER IF EXISTS `Databasesub1`.`ชื่อทริกเก้อตั้งไรก้ได้`;
DELIMITER $$
USE `Databasesub1`$$
CREATE DEFINER=`Databasemain`@`%` TRIGGER `Databasesub1`.`ชื่อทริ้กเก้อ` AFTER UPDATE ON `tablea`
FOR EACH ROW
BEGIN
UPDATE `Databasemain`.`tablea` SET `value`= new.value WHERE `ID`= old.id ;
END$$
DELIMITER ;