x
login about faq Site discussion (meta-askssc)

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 .

more ▼

asked Feb 02 '10 at 04:16 AM in Default

java gravatar image

java
9 3 4 4

(comments are locked)
10|1200 characters needed characters left

2 answers: sort voted first
INSERT #tmp (col1,col2)
SELECT a.col1,b.col1
FROM table1 a
JOIN table2 b ON (a.ID = b.ID)
more ▼

answered Feb 02 '10 at 04:28 AM

Scot Hauder gravatar image

Scot Hauder
5.7k 13 15 18

(comments are locked)
10|1200 characters needed characters left

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?

more ▼

answered Feb 02 '10 at 04:27 AM

Steinar gravatar image

Steinar
1.7k 3 4 6

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

Feb 03 '10 at 03:48 PM java
(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments



Facebook logo Follow Ask SSC on Facebook
Find Ask SSC on Google+
linkedin logo Find us on LinkedIn

Topics:

x912
x220

asked: Feb 02 '10 at 04:16 AM

Seen: 1733 times

Last Updated: Feb 02 '10 at 08:01 AM

Copyright © 2002-2012 Simple Talk Publishing. All Rights Reserved. If you have any queries, please contact the site administrators.
Ask SQL Server Central is a community service provided by Red Gate.