Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Select statement

Author  Topic 

krista80
Starting Member

29 Posts

Posted - 2011-02-24 : 14:43:55
I have a select statement that looks like this:

INSERT INTO table3 (ACC)
(SELECT FAC FROM table4
WHERE
table2.Temp_Serv = table4.Serv)

Any help is greatly appreciated.

robvolk
Most Valuable Yak

15732 Posts

Posted - 2011-02-24 : 14:52:16
INSERT INTO table3 (ACC)
SELECT FAC FROM table4
INNER JOIN table2 ON table2.Temp_Serv = table4.Serv
Go to Top of Page

jimf
Master Smack Fu Yak Hacker

2875 Posts

Posted - 2011-02-24 : 14:53:41
You'll probably need to join table3, table2 and table4. To start , all of those tables should appear in the FROM clause using JOINs.

Jim

Everyday I learn something that somebody else already knew
Go to Top of Page

jimf
Master Smack Fu Yak Hacker

2875 Posts

Posted - 2011-02-24 : 14:55:16
Oops, thought it was update and not insert for some reason!

Never mind,

Jim

Everyday I learn something that somebody else already knew
Go to Top of Page

krista80
Starting Member

29 Posts

Posted - 2011-02-25 : 08:13:36
Thanks everyone! It worked!
Go to Top of Page
   

- Advertisement -