x

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, 2010 at 04:16 AM in Default

java gravatar image

java
9 4 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, 2010 at 04:28 AM

Scot Hauder gravatar image

Scot Hauder
6k 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, 2010 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, 2010 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.

New code box

There's a new way to format code on the site - the red speech bubble logo will automatically format T-SQL for you. The original code box is still there for XML, etc. More details here.

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

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x986
x246

asked: Feb 02, 2010 at 04:16 AM

Seen: 2321 times

Last Updated: Feb 02, 2010 at 08:01 AM