Say I have a index (id, name) and want to execute a query like:
update <table> set name='new name' where name='old name'
Then I got error like:
Query Error: columns id, name are not unique Unable to fetch row.
What is that error? And how can I update that column without getting error?
It would help if you could show the contents of
<table>, at least all the rows withname = 'new name'orname = 'old name'.However, the most logical assumption is that there already exist in your table two rows with the same
id, one of them having the value'new name'and the other having the value'old name'in thenamefield. If that’s true, and you run thisUPDATEthen the results would violate anyPRIMARY KEYorUNIQUEindex on that combination of fields.