REPLACE in Mysql
REPLACE is 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 a UNIQUE index, the old row is deleted before the new row is inserted.
REPLACE INTO is a much slower performer than an UPDATE statement.We need REPLACE INTO when we have multiple unique constraints on a table, and need to drop any rows that would match any of the constraints.
Syntax :
REPLACE INTO [tbl_name] SET [col1_name]=[value1], [col2_name]=[value2],…
