Mysql
 sql >> Base de Dados >  >> RDS >> Mysql

Excluir linha com um Mysql Trigger


Na sua cláusula where, altere new.id para old.id
-- Trigger DDL Statements
DELIMITER $$

USE `db_dhruniversity`$$

CREATE
TRIGGER `db_dhruniversity`.`ai_delete_course`
AFTER DELETE ON `jos_jquarks_quizzes`
FOR EACH ROW
BEGIN    
DELETE FROM jos_jquarks_courses
WHERE (quiz_id = old.id); 
END$$