Skip to content
Advertisement

INSERT INTO … VALUES () when not exists

I have insert:

I know that I can use where not exists when there is SELECT in INSERT instead of VALUES() (Oracle insert if not exists statement). Is it somehow possible in this case without changing this INSERT ... VALUES() into INSERT... SELECT?

Advertisement

Answer

Use insert . . . select and add the condition to the end of the SELECT:

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement