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 2000 Forums
 SQL Server Development (2000)
 Updating a table with value from select statement

Author  Topic 

willphill
Starting Member

1 Post

Posted - 2005-08-30 : 08:47:44
I have a long select statement with a rather long where clause. Basically I am selecting multiple rows of data and calculating a Sum. How can I then take the Sum from the select statement and dump it into a different table?

mfemenel
Professor Frink

1421 Posts

Posted - 2005-08-30 : 08:55:31
insert into mytable(fieldname)
select mysum from (select (field1 + field2 + field3) as mysum from a table)base


Mike
"oh, that monkey is going to pay"
Go to Top of Page
   

- Advertisement -