MENU
REPLACE
| REPLACE | [LOW_PRIORITY] [INTO] tbl_name [PARTITION (partition_name,...)] [(col_name,...)] {VALUES | VALUE} ({expr | DEFAULT},...),(...),... |
| REPLACE | [LOW_PRIORITY] [INTO] tbl_name [PARTITION (partition_name,...)] SET col_name={expr | DEFAULT}, ... |
| REPLACE | [LOW_PRIORITY] [INTO] tbl_name [PARTITION (partition_name,...)] [(col_name,...)] SELECT ... |
| REPLACE is the same as INSERT, except that when there is a duplicate value for a PRIMARY KEY or a UNIQUE index, the old row is deleted before the insertion. | |
| A REPLACE statement returns the sum of the rows deleted and inserted. | |