Monthly Archives: August 2018

What are the differences between INSERT, UPDATE, REPLACE in MySql?

These are totally different statements. Insert: Insert new record. Example : INSERT INTO table(fields) VALUES(values); Update: Update existing record Example : UPDATE table SET fields=values Where conditions; Replace: This syntax is the same as the INSERT. The old row is deleted before the new row is inserted. Example : REPLACE INTO table SET fields=values;