还是MySQL新手。我的语法在哪里出错?
CREATE EVENT `event_name` ON SCHEDULE EVERY 15 MINUTE ON COMPLETION PRESERVE
DO
BEGIN
INSERT INTO table_1 (column_name) SELECT column FROM table_1 WHERE column REGEXP 'regex_string'
END;
答案 0 :(得分:0)
删除BEGIN
和END
,因为它不是复合语句,如果您的列名是column
,则将其转义为
CREATE EVENT `event_name` ON SCHEDULE EVERY 15 MINUTE ON COMPLETION PRESERVE
DO
INSERT INTO table_1 (column_name)
SELECT `column` FROM table_1
WHERE `column` REGEXP 'regex_string';