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 27, 2021 09:09AM

Here's some of my totally failed code.

INSERT INTO tbl_points (name, points) VALUES ('ed',19) ON DUPLICATE KEY UPDATE points = points + 19;

My terminal then says this was submitted successfully, but when I check the table I find it did not work:

The existing row was not updated. Instead a new row was inserted.

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.