possible to insert select query results?
hi,
I am wondering if I can insert the result of a select query from
one table into another table. I have 3 tables: emp1, emp2, emp1_emp2, I want to insert pks of emp1 and emp2 into their association table emp1_emp2. If I can insert a row into emp1 and emp2 first, then insert their pks into their association table, I can save a second hit to db. Can I achieve something similar to this (I know the following won't work)?:
insert into emp1_emp2 values (select emp1_id from emp1, select from emp2_id from emp2);
thanks