'Prevent trigger from updating all rows
I'm new to databases in fact i'm still learning by self-taught right now, what i'm missing from this trigger query?
DELIMITER //
CREATE TRIGGER scores_insert
AFTER INSERT ON scoreList
FOR EACH ROW
BEGIN
IF NEW.score > 75 THEN
UPDATE student SET `status` = 'pass' WHERE (#condition)
ELSE
UPDATE student SET `status` = 'fail' WHERE (#condition)
END IF;
END; //
i've tried using subquery to #condition but its stll updating all the rows 😅
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
