Sqlserver
 sql >> Database >  >> RDS >> Sqlserver

Inserisci in con più sottoquery come valori

insert into mytable (columns)
select somevalue, somevalue, a.id, b.id, c.id
from
 othertable1 a
 cross join othertable2 b
 cross join othertable3 c
where
 a ... condition
 b ... condition
 c ... condition