Basically I want to extract id from a table and insert that id in another table with some other data. So the algorythm goes:
foreach id in (select id from table)
{
insert into table2 values (id,etc,etc);
}
How to perform this function with an SQL query?