List:General Discussion« Previous MessageNext Message »
From:Daniel Wood Date:May 6 2008 12:57pm
Subject:Insert ... select
View as plain text  
Hi all,

Apologies if this isn't the correct list but I couldn't see a more  
suitable one.

I have 4 tables. t1 and t3 are a many to many relationship and use t2  
as link table. t3 has many t4.

What I want to do is insert a new row into t3 for each row in t1. I  
then want to add the corresponding row in the link table and also add  
optional rows in t4 that refer to the new row in t3.  I hope this  
makes some sense.

I could do this with PHP fairly simply but I'm wondering if something  
like this is possible in sql as then I can add it to my db migrations.

Regards
Dan


Thread
Insert ... selectDaniel Wood6 May 2008