The problem is actually quite simple, you are updating multiple records, having the PRIMARY KEY or UNIQUE KEY included in the input data and the resulting UPDATE operation matches more than one row. Hence one or more rows having a different PRIMARY KEY or UNIQUE KEY is being updated with the input value which already exists in another row and the attempt to update the other rows throws a duplicate error.
Fix this by simply using the UNIQUE KEY or PRIMARY KEY in the WHERE condition.
No comments:
Post a Comment