db2 - sql statement to select and insert one value from one table rest from outside the tables -
i have 2 db2 tables, table 1 contains rows of constant data id 1 of columns. second table contains id column foreign key id column in first table , has 3 more varchar columns.
i trying insert rows second table, entry id col based on clause , remaining columns values outside.
table1 has columns id, t1c1, t1c2, t1c3 table2 has columns id, t2c1, t2c2, t2c3
to insert table2, trying query:
insert table2 values (select id table1 t1c2 'xxx', 'abc1','abc2');
i know basic missing here. please correcting query.
Comments
Post a Comment