question

java avatar image
java asked

to ask a question on join using insert statement

hello,can u plz tell me how to use insert statement using join with a proper example.normally we use joins with select statement .

t-sqlperformance
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Scot Hauder avatar image
Scot Hauder answered
INSERT #tmp (col1,col2)
SELECT a.col1,b.col1
FROM table1 a
JOIN table2 b ON (a.ID = b.ID)
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Steinar avatar image
Steinar answered

Hello!

Can you please provide more information about what you want to do? What does the tables look like? What data do yu want to insert?

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

java avatar image java commented ·
there r two tables ,i just wana know whether we can make use of insert statement in joins or not.normally the query for joins is select a.name,b.address from abc a join asz b on a.id=b.id.but iwana make use of insert statement in join.,if its possible plz tell me the answer,with proper eg
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.