insert批量插入優化方案

MC811-MM118發表於2021-07-07

以前我用這樣的:

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);

現在我用這樣的:

INSERT INTO insert_table (datetime, uid, content, type) VALUES (‘0’, ‘userid_0’, ‘content_0’, 0), (‘1’, ‘userid_1’, ‘content_1’, 1);

本作品採用《CC 協議》,轉載必須註明作者和本文連結
如果覺得我寫的不錯,記得和我交流,其實我也有很多不懂,嘻嘻!

相關文章