Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to Insert data into single table using select from multiple tables

ForSlyMay 21 2019 — edited May 21 2019

i am trying to insert data from multiple tables using this query but keep getting ORA -SQL Error: ORA-00913: too many values. What I am trying to do is basically insert data into target table from source table but only if the new data is not already in the target table.

INSERT INTO target_table A

(a.target_tableI_NUMBER,target_table.ID, a._NAME)

SELECT s.NUMBER,a.ID,sID, s.NAME  FROM Source_table s , target_tableI a

WHERE EXISTS (SELECT 1 FROM  Source_table s  WHERE s._ID = a.ID);

This post has been answered by L. Fernigrini on May 21 2019
Jump to Answer
Comments
Post Details
Added on May 21 2019
5 comments
9,839 views