Re: How do i update existing records with new values where the values don't always exist.
Posted by: Peter Brawley
Date: January 15, 2019 11:34AM

We can't just make up syntax. Read the manual page on Insert...Select... again ...

- literals aren't supported before the Select clause

- you can't conflate two rows of literal values into one

- the column assignment list, if present, has to exactly match target table columns for which you supply values

- your where in(...) clause refers back to the target table, a simple join would be better here

- these are rows that don't exist, so an on duplicate... clause isn't needed.

If you have trouble correcting these errors, please post Show Create Table results for the two tables plus a clear description in English (not in fractured sql!) of the requirement.

(To improve human readability of your posts, enclose code in BBCode code tags.)

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.