I have an index uniquein a column with a name label, but for some strange reason why I am trying to update, for example:
UPDATE books SET label = 'foo bar', title = 'something new', modified = UTC_TIMESTAMP();
And there already exists a line with the label = 'foo bar', these are errors:
#1062 - Duplicate entry 'foo bar' for key 'label'
How to make MySQL do an update? This should not break, because technically there is another line with the key foo bar.
Thank.
source
share