Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2002-06-21 : 08:25:47
|
boon writes "INSERT record in relation to another table >>As in I want to insert record in table A, but the inserted record is actually multiple rows from table BTable A:roomID ID(from tableB)room1 1room1 2room1 3room1 4room1 5room2 1room2 2... ...Table B:ID row seatnumber1 1 12 1 23 1 34 2 15 2 2... ... ... --------------------I want to use a SINGLE sql statement to insert a new room with the IDs from table BHow do I do that?thanks Gurus" |
|
|
YellowBug
Aged Yak Warrior
616 Posts |
Posted - 2002-06-21 : 10:25:16
|
| Lookup CROSS JOIN in BOLs for more information.INSERT TableASELECT TableB.ID, tb.ID2 from TableBCROSS JOIN (select ID as ID2 from TableB) as tb |
 |
|
|
|
|
|