Updated on 2024-04-28 GMT+08:00

REPLACE

In MySQL, REPLACE allows the following keywords: LOW_PRIORITY, PARTITION, DELAYED, VALUES, and SET. The following examples are temporary migration solutions only.

REPLACE works exactly like INSERT, except that if an old row in the table has the same value as a new row for a primary key or unique index, the old row is deleted before the new row is inserted.