如何在觸發器中停止Event
。例如:我有下面這個簡單的代碼:MySQL在觸發器中停止事件
CREATE TRIGGER checkPlayer BEFORE INSERT ON players
BEGIN
DECLARE ctr INT;
SELECT count(*)
INTO ctr
FROM players
WHERE fName = NEW.fName
AND lName = NEW.lName;
IF ctr > 0 THEN
-- LEAVE and don't insert because player exists
END IF;
END
謝謝隊友,我一直在尋找一個詞來搜索,這實際上是你說的「信號」,真的有幫助 – bluezald