mysql 批量插入

START TRANSACTION;
INSERT INTO `insert_table` (`datetime`, `uid`, `content`, `type`) 
VALUES ('0', 'userid_0', 'content_0', 0);
INSERT INTO `insert_table` (`datetime`, `uid`, `content`, `type`) 
VALUES ('1', 'userid_1', 'content_1', 1);
...
COMMIT;
begin;
INSERT INTO `insert_table` (`datetime`, `uid`, `content`, `type`) 
VALUES ('0', 'userid_0', 'content_0', 0);
INSERT INTO `insert_table` (`datetime`, `uid`, `content`, `type`) 
VALUES ('1', 'userid_1', 'content_1', 1);
...
COMMIT;

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注