INSERT IGNORE:
INSERT IGNORE is used for handling duplicacy in a table as it ignores the query if the data is already present in the table and if the data does not exist then new row will be inserted.
Syntax:
INSERT IGNORE INTO tablename (column1,column2, ......, columnN) VALUES( value1, value2,.....,valueN);
Example:
INSERT IGNORE INTO Employee (name,city) VALUES( 'Ankur', 'Delhi');
This query will insert the name and city if they are not already present in the table Employee otherwise it will simply ignore the query and no new row will be inserted.
0 Comment(s)