Reputation: 6163
Is there a relatively simple way to insert multiple rows into a table in which the data being inserted comes from both a select statement and hard-coded data?
For example,
insert into tblB
(field1, field2, field3)
values
( 950, select fieldA, fieldB from tblA )
...where 950 is a hard-coded value and fieldA
and fieldB
come from tblA
Upvotes: 2
Views: 8791
Reputation: 149
insert into tablename(fieldname1,fieldname2,...)values(value1,value2,....)
Upvotes: 0
Reputation: 171411
insert into tblB
(field1, field2, field3)
select 950, fieldA, fieldB
from tblA
Upvotes: 9