Hi all,I need a 'lil help for an insert query having a select subquery. I'd created two tables such that...create table table1 ( a int primary key, b varchar(100))create table table2 ( c int primary key, d varchar(100), a int references table1(a) )insert into table1 values(1, 'red')insert into table1 values(2, 'yellow')
And I want to select the value of column "a" from table1 for some corresponding value of column "b". Then this value will be inserted into table2, and all of this work will be completed in one query, as...insert into table2 values(1, 'abc', (select a from table1 where b=2))
What'll be the appropriate command?