user3167167
user3167167

Reputation: 93

Insert from 2 tables into 1 table

I would like to insert columns from 2 different tables into one table. The following is not working on the second Insert. Is this possible to do this way? the receiving table is currently empty. the idea is to have one row in the third table per the 2 inserts.

INSERT INTO CA1665AFTT.EMODESADV3         
     (E3ecsn, e3mena, e3hand)              
  SELECT  e1ecsn, e1mena, e1hand           
    FROM CA1665AFTT.EMODESADV1             
  INSERT INTO CA1665AFTT.EMODESADV3        
      (E3CPRD, E3CQTY)                     
   SELECT  prdc, oqty                      
     FROM Monica.emod                     

Upvotes: 0

Views: 43

Answers (1)

aguetat
aguetat

Reputation: 514

Yes it's possible using a join between the two tables

Upvotes: 2

Related Questions