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?
Use
insert into table2
select id, etc, etc from table
instead of for loop.
Here's a helpful article.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With