mysql-我可以用多个值INSERT IGNORE吗?

Ash*_*Ash 7 mysql insert

我有以下代码:

INSERT IGNORE INTO unsubscribes (email) VALUES (john@john.com),(kevin@kevin.com),(mike@mike.com),(another@gmail.com)
Run Code Online (Sandbox Code Playgroud)

但它反复返回错误......

错误是:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@john.com),(kevin@kevin.com),(mike@mike.com),(another' at line 1
Run Code Online (Sandbox Code Playgroud)

有什么想法吗?使用多个值插入忽略是合法的吗?

Sha*_*ngh 15

将值放在引号内.

这会奏效

INSERT IGNORE INTO unsubscribes (email) 
VALUES ('john@john.com'),
       ('kevin@kevin.com'),
       ('mike@mike.com'),
       ('another@gmail.com')
Run Code Online (Sandbox Code Playgroud)

请注意,varchar,text等值应该在引号内.