MySQL Forums
Forum List  »  Newbie

Re: I need a column that automatically adds the new number with the old number. Possible?
Posted by: rosewood mahogany
Date: May 25, 2021 09:38AM

> Apparently the requirement is to add a row for a name that does not exist, otherwise update the total for that name

Yes

> Have a look at "insert on duplicate key"

I have tried like 100 things and nothing worked.

I became mostly interest in "insert SELECT", eg reading the "points" and then doing "points = points + points."

But when I selected the data (from the very same table I was about to update) I got an error that this wasn't allowed.

On forums many people said there are probably ways around this. But I never saw a solution.

This is especially sad because this should be a very simple thing!

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.