REPLACE INTO Statement:
It is used to insert a row in a table.It is similar to INSERT INTO statement but it does not allow duplicate row as it replaces the old one with the new one.
Syntax:
REPLACE INTO tablename (column1, column2, column3) VALUES( value1, value2, value3);
Example:
REPLACE INTO Employee (name, city) VALUES ( 'Amit', 'Dehradun');
This query will insert Amit in name column and dehradun in city column but if the same name and city are already present in the employee table than it will replace the old one with the new one.
0 Comment(s)