sql語句批次新增資料的方法是什麼?
方法1:逐條執行,速度慢。
INSERT INTO testimport (name, message)VALUES ('testname', 'jfksdfkdsfjksadljfkdsfjsdlafjdaslkfjasfd'); INSERT INTO testimport (name, message)VALUES ('testname', 'jfksdfkdsfjksadljfkdsfjsdlafjdaslkfjasfd'); INSERT INTO testimport (name, message)VALUES ('testname', 'jfksdfkdsfjksadljfkdsfjsdlafjdaslkfjasfd');
方法2:批次執行,適用於 SQL Server。
INSERT INTO testimport (name, message) VALUES ('testname', 'jfksdfkdsfjksadljfkdsfjsdlafjdaslkfjasfd'), ('testname', 'jfksdfkdsfjksadljfkdsfjsdlafjdaslkfjasfd'), ('testname', 'jfksdfkdsfjksadljfkdsfjsdlafjdaslkfjasfd');
方法3:批次執行,適用於Oracle。
INSERT ALL INTO A (name, message) VALUES ('testname', 'jfksdfkdsfjksadljfkdsfjsdlafjdaslkfjasfd') INTO A (name, message) VALUES ('testname', 'jfksdfkdsfjksadljfkdsfjsdlafjdaslkfjasfd') INTO A (name, message) VALUES ('testname', 'jfksdfkdsfjksadljfkdsfjsdlafjdaslkfjasfd') SELECT 1 FROM DUAL;
推薦教學:《sql教學》
以上是sql語句批量添加資料的方法是什麼的詳細內容。更多資訊請關注PHP中文網其他相關文章!