MySQL Forums
Forum List  »  Stored Procedures

Re: If exist Update else insert query
Posted by: Peter Brawley
Date: December 07, 2020 10:52AM

Right, we can't just make up syntax, specifically we can Insert a Select but we can't Select an Update or Insert.

There is sytx for what you're trying to do, which is update something if it's there else insert it. Read about Inseert ... On Duplicate Key Update ... on the Insert page of the manual.

Options: ReplyQuote

Written By
December 07, 2020 01:33AM
Re: If exist Update else insert query
December 07, 2020 10:52AM

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.