如果某些条件在Before Insert trigger mysql中变为false,如何避免插入查询?
以下是我想要做的一个例子:
CREATE DEFINER = CURRENT_USER TRIGGER `mtdb`.`Mytable_BEFORE_INSERT`
BEFORE INSERT ON `Mytable` FOR EACH ROW
BEGIN
IF (NEW.mobile IS NULL OR NEW.mobile = "")
THEN
**DO NOT INSERT, RETURN SOME ERROR MESSAGE
END IF;
END