Data conversions that would trigger errors abort the statement if IGNORE  is not specified. With IGNORE , invalid values are adjusted to the closest values and inserted; warnings are produced but the statement does not abort. You can determine with the mysql_info() C API function how many rows were actually inserted into the table. 

For more information, see The Effect of IGNORE on Statement Execution. 

You can use REPLACE  instead of INSERT  to overwrite old rows. REPLACE  is the counterpart to INSERT IGNORE  in the treatment of new rows that contain unique key values that duplicate old rows: The new rows replace the old rows rather than being discarded. See Section 13.2.9, “REPLACE Statement” . 

•If you specify ON DUPLICATE KEY UPDATE , and a row is inserted that would cause a duplicate value in a UNIQUE  index or PRIMARY KEY , an UPDATE  of the old row occurs. The affected-rows value per row is 1 if the row is inserted as a new row, 2 if an existing row is updated, and 0 if an existing row is set to its current values. If you specify the CLIENT_FOUND_ROWS  flag to the mysql_real_connect() C API function when connecting to mysqld , the affected-rows value is 1 (not 0) if an existing row is set to its current values. See Section 13.2.6.2, “INSERT ... ON DUPLICATE KEY UPDATE Statement” . 

• INSERT DELAYED  was deprecated in MySQL 5.6, and is scheduled for eventual removal. In MySQL 8.0, the DELAYED  modifier is accepted but ignored. Use INSERT  (without DELAYED ) instead. See Section 13.2.6.3, “INSERT DELAYED Statement” . 

## 13.2.6.1 INSERT ... SELECT Statement 

INSERT [LOW_PRIORITY | HIGH_PRIORITY] [IGNORE] [INTO] tbl_name [PARTITION ( partition_name  [, partition_name ] ...)] [( col_name  [, col_name ] ...)] {SELECT ... | TABLE table_name } [ON DUPLICATE KEY UPDATE assignment_list ] value : { expr  | DEFAULT} assignment : col_name  = value assignment_list : assignment  [, assignment ] ... 

With INSERT ... SELECT , you can quickly insert many rows into a table from the result of a SELECT statement, which can select from one or many tables. For example: 

INSERT INTO tbl_temp2 (fld_id) SELECT tbl_temp1.fld_order_id FROM tbl_temp1 WHERE tbl_temp1.fld_order_id > 100; 

Beginning with MySQL 8.0.19, you can use a TABLE  statement in place of SELECT , as shown here: 

INSERT INTO ta TABLE tb; 

TABLE tb  is equivalent to SELECT * FROM tb . It can be useful when inserting all columns from the source table into the target table, and no filtering with WHERE is required. In addition, the rows from TABLE  can be ordered by one or more columns using ORDER BY , and the number of rows inserted can be limited using a LIMIT  clause. For more information, see Section 13.2.12, “TABLE Statement” . 

The following conditions hold for INSERT ... SELECT  statements, and, except where noted, for INSERT ... TABLE  as well: 

•Specify IGNORE  to ignore rows that would cause duplicate-key violations. 

