I have a unique
index on a column named label
, but for some strange reason why I try and do an update like:
UPDATE books SET label = 'foo bar', title = 'something new', modified = UTC_TIMESTAMP();
And there already exists a row with label = 'foo bar' this errors:
#1062 - Duplicate entry 'foo bar' for key 'label'
How can I make MySQL do the update? This shouldn't be breaking because technically there is still just one row with the key foo bar
.
Thanks.