这看起来对我来说,
但是当我运行时,MySQL说。
'delimiter'附近的第1行存在语法错误
这是我第一次使用MySQL。如果我做的话傻话,请告诉我。谢谢!
DELIMITER $$
DROP TRIGGER IF EXISTS TR_ARCHIVE_UNITS $$
CREATE TRIGGER TR_ARCHIVE_UNITS
BEFORE DELETE ON unit_tracking
FOR EACH ROW
BEGIN
INSERT IGNORE INTO unit_tracking_HIST (id, dateAdded, unitCondition, make, model, unit_num, consign_flag, serial_num, description, gl_num, trade, invoice_posted, notes, deleted_date, user_deleted)
SELECT id, dateAdded, unitCondition, make, model, unit_num, consign_flag, serial_num, description, gl_num, trade, invoice_posted, notes
FROM unit_tracking
WHERE id = OLD.id;
END $$
DELIMITER;
答案 0 :(得分:1)
请将DELIMITER;
更改为DELIMITER ;