我有 1 条记录需要输入到表格中.在查询中执行此操作的最佳方法是什么?我应该做一个循环并在每次迭代中插入一条记录吗?或者有更好的方法吗?
I have 1-many number of records that need to be entered into a table. What is the best way to do this in a query? Should I just make a loop and insert one record per iteration? Or is there a better way?
来自 MySQL 手册
使用 VALUES 的 INSERT 语句语法可以插入多行.去做这包括多个列列表值,每个值都包含在括号并用逗号分隔.示例:
INSERT statements that use VALUES syntax can insert multiple rows. To do this, include multiple lists of column values, each enclosed within parentheses and separated by commas. Example:
INSERT INTO tbl_name (a,b,c) VALUES(1,2,3),(4,5,6),(7,8,9);
这篇关于如何在 MySQL 中进行批量插入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
分解表以按列进行透视(SQL、PYSPARK)Break down a table to pivot in columns (SQL,PYSPARK)(分解表以按列进行透视(SQL、PYSPARK))
使用 SparkSQL 删除 MySQL 表Dropping MySQL table with SparkSQL(使用 SparkSQL 删除 MySQL 表)
Spark在执行jdbc保存时给出空指针异常Spark giving Null Pointer Exception while performing jdbc save(Spark在执行jdbc保存时给出空指针异常)
使用 spark sql 在 sqlserver 上执行查询execute query on sqlserver using spark sql(使用 spark sql 在 sqlserver 上执行查询)
如何有效地使用窗口函数根据 N 个先前值来决定How to use windowing functions efficiently to decide next N number of rows based on N number of previous values(如何有效地使用窗口函数根据
Spark SQL/Hive 查询永远需要加入Spark SQL/Hive Query Takes Forever With Join(Spark SQL/Hive 查询永远需要加入)