Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Handling Duplicates using INSERT IGNORE

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 619
    Comment on it

    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)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: