Tablodaki sütunu, aynı tablodaki güncellemeden sonra nasıl tetikleyebilirim? YaniTabloda aynı tablodan sonra tetiklendikten sonra tablo güncelleniyor
#1442 - Can't update table 'products_score' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
nasıl yeryüzünde: Aşağıdaki olsun ben, bu işe yaramazsa
UPDATE products_score SET votes_1 = 5 WHERE id = 0
gibi tablo güncelleştirme Şimdi
CREATE TRIGGER upd_total_votes AFTER UPDATE ON products_score
FOR EACH ROW
UPDATE
products_score
SET
products_score.votes_total =
(SELECT
(votes_1 + votes_2 + votes_3 + votes_4 + votes_5)
FROM
products_score
WHERE
id = new.id)
:
İşte tetik Bunu işe alabilir miyim? yerine AFTER
ait BEFORE
için tetiği değiştirirseniz
Mükemmel yanıt – jdborg