MySQL 8.0-13.2.6 INSERT Statement

13.2.6.1 INSERT ... SELECT Statement

13.2.6.2 INSERT ... ON DUPLICATE KEY UPDATE Statement

13.2.6.3 INSERT DELAYED Statement



INSERT [LOW_PRIORITY | DELAYED | HIGH_PRIORITY] [IGNORE]
    [INTO] tbl_name
    [PARTITION (partition_name [, partition_name] ...)]
    [(col_name [, col_name] ...)]
    { {VALUES | VALUE} (value_list) [, (value_list)] ...
      |
      VALUES row_constructor_list
    }
    [AS row_alias[(col_alias [, col_alias] ...)]]
    [ON DUPLICATE KEY UPDATE assignment_list]

INSERT [LOW_PRIORITY | DELAYED | HIGH_PRIORITY] [IGNORE]
    [INTO] tbl_name
    [PARTITION (partition_name [, partition_name] ...)]
    [AS row_alias[(col_alias [, col_alias] ...)]]
    SET assignment_list
    [ON DUPLICATE KEY UPDATE assignment_list]

INSERT [LOW_PRIORITY | HIGH_PRIORITY] [IGNORE]
    [INTO] tbl_name
    [PARTITION (partition_name [, partition_name] ...)]
    [(col_name [, col_name] ...)]
    [AS row_alias[(col_alias [, col_alias] ...)]]
    {SELECT ... | TABLE table_name}
    [ON DUPLICATE KEY UPDATE assignment_list]

value:
    {
  expr | DEFAULT}

value_list:
    value [, value] ...

row_constructor_list:
    ROW(value_list)[, ROW(value_list)][, ...]

assignment:
    col_name = [row_alias.]value

assignment_list:
    assignment [, assignment] ...

INSERT inserts new rows into an existing table. The INSERT ... VALUESINSERT ... VALUES ROW(), and INSERT ... SET forms of the statement insert rows based on explicitly specified values. The INSERT ... SELECT form inserts rows selected from another table or tables. You can also use INSERT ... TABLE in MySQL 8.0.19 and later to insert rows from a single table. INSERT with an ON DUPLICATE KEY UPDATE clause enables existing rows to be updated if a row to be inserted would cause a duplicate value in a UNIQUE index or PRIMARY KEY. In MySQL 8.0.19 and later, a row alias with one or more optional column alises can be used with ON DUPLICATE KEY UPDATE to refer to the row to be inserted.

INSERT将新行插入到现有表中。INSERT ... VALUES,INSERT ... VALUES ROW()和IINSERT ... SET形式,根据显式指定的值插入行。INSERT ... SELECT形式,插入从另一个或多个表中选择的行。你也可以使用INSERT ... TABLE在MySQL 8.0.19和更高版本中插入一个表中的行。如果要插入的行会导致UNIQUE索引或PRIMARY KEY中的重复值,则使用ON DUPLICATE KEY UPDATE子句的INSERT允许更新现有行。在MySQL 8.0.19和更高版本中,一个带有一个或多个可选列的行别名可以与ON DUPLICATE KEY UPDATE一起使用,以引用要插入的行。

For additional information about INSERT ... SELECT and INSERT ... ON DUPLICATE KEY UPDATE, see Section 13.2.6.1, “INSERT ... SELECT Statement”, and Section 13.2.6.2, “INSERT ... ON DUPLICATE KEY UPDATE Statement”.

In MySQL 8.0, the DELAYED keyword is accepted but ignored by the server. For the reasons for this, see Section 13.2.6.3, “INSERT DELAYED Statement”,

在MySQL 8.0中,延迟关键字被接受,但服务器忽略。原因见13.2.6.3节“INSERT DELAYED Statement”,

Inserting into a table requires the INSERT privilege for the table. If the ON DUPLICATE KEY UPDATE clause is used and a duplicate key causes an UPDATE to be performed instead, the statement requires the UPDATE privilege for the columns to be updated. For columns that are read but not modified you need only the SELECT privilege (such as for a column referenced only on the right hand side of an col_name=expr assignment in an ON DUPLICATE KEY UPDATE clause).

插入到表中需要该表的INSERT权限。如果使用ON DUPLICATE KEY UPDATE子句,而重复的键导致执行UPDATE,则该语句需要更新列的UPDATE特权。对于读但不修改的列,您只需要SELECT权限(例如,对于只在on DUPLICATE KEY UPDATE子句中的col_name=expr赋值右边引用的列)。

When inserting into a partitioned table, you can control which partitions and subpartitions accept new rows. The PARTITION clause takes a list of the comma-separated names of one or more partitions or subpartitions (or both) of the table. If any of the rows to be

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
DevExpress 13.2.6 是一款软件开发工具包(SDK),用于创建企业级应用程序。这个版本发布于2013年底,是DevExpress公司更新的一个版本。 DevExpress 13.2.6 提供了丰富的功能和工具,可以帮助开发人员轻松创建跨平台的桌面应用程序、Web应用程序和移动应用程序。它支持多种编程语言,包括C#、VB.NET、HTML和JavaScript,使开发人员能够选择最适合他们项目的语言。 这个版本的DevExpress还提供了许多先进的控件和组件,如图表控件、网格控件、数据输入控件等,可以帮助开发人员快速构建用户界面。它还提供了丰富的数据绑定和数据处理功能,使开发人员能够轻松处理和管理数据。 此外,DevExpress 13.2.6 还提供了强大的报表和分析工具,用于创建精美的报表和实时数据分析。它支持多种报表类型,包括表格、图表、交叉表等,可以满足各种报表需求。 与此同时,DevExpress 13.2.6 也具有良好的性能和稳定性。它经过了严格的测试和优化,可以处理大量数据和复杂的业务逻辑,同时保持良好的响应速度和稳定性。 总的来说,DevExpress 13.2.6 是一款功能强大、易于使用的软件开发工具包,可以帮助开发人员快速创建高质量的企业级应用程序。无论是桌面应用程序、Web应用程序还是移动应用程序,它都提供了丰富的功能和工具,使开发人员能够轻松实现他们的想法。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值