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

avatar image

java
9 4 4 5

(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

avatar image

Scot Hauder
6.4k 13 16 22

(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

avatar image

Steinar
1.7k 4 6 10

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.

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:

x1066
x288

asked: Feb 02, 2010 at 04:16 AM

Seen: 2653 times

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

Copyright 2016 Redgate Software. Privacy Policy