I am trying to run 3 queries in my database:
UPDATE `table` SET `rubriq` = '77' WHERE `rubriq` = '61';
UPDATE `table` SET `rubriq` = '77' WHERE `rubriq` = '62';
UPDATE `table` SET `rubriq` = '77' WHERE `rubriq` = '63';
In tableI have two columns abonneand rubriq. Abonne is the primary key, and two are the index.
If there is in my database, for example:
abonne | rubriq
84 | 61
84 | 62
84 | 63
When I run my 3 queries, there is no problem for the first, but for the second I have an error: #1062 - Duplicate entry '84-77' for key 1
How can I do this to run these 3 queries, but when there is such an error, just delete the line?
Thanks!
source
share