Answer the question
In order to leave comments, you need to log in
How to put two conditions in one trigger?
BEGIN
IF ((SELECT SUM(field_310) FROM app_entity_8 WHERE field_581=(SELECT `id` FROM `app_entity_9`))=(SELECT `field_329` FROM `app_entity_9`)) THEN
UPDATE `app_entity_9` SET `field_586`=53 WHERE `app_entity_9`.`id`=new.field_581;
END IF;
IF ((SELECT SUM(field_310) FROM app_entity_8 WHERE field_581=(SELECT `id` FROM `app_entity_9`))<(SELECT `field_329` FROM `app_entity_9`)) THEN
UPDATE `app_entity_9` SET `field_586`=54 WHERE `app_entity_9`.`id`=new.field_581;
END IF;
END
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question