I had some weirdness with MySQL today… Updating on a duplicate key error works like a charm: it updates the row which violates with the key and everybody is happy! Well, actually I’m not… I encountered this problem today. I had a table with a number and an average and the table named averages looked…