Hi All,
SQL 2008
I have 2 tables, I would like to update the second table with results from the first table. Currently I am doing it like, using a temporary table:
I was wondering if it is possible doing this, but without the need of a temporaty table ?
Any information is appreciated.
Thanks
Michael
SQL 2008
I have 2 tables, I would like to update the second table with results from the first table. Currently I am doing it like, using a temporary table:
Code:
select column1 ,COUNT(*) as vol
into #temp1
from table1
group by column1
UPDATE table2
SET column = vol
FROM table2 INNER JOIN
#temp1 ON table2.column2 = #temp1.column1
drop table #temp1
I was wondering if it is possible doing this, but without the need of a temporaty table ?
Any information is appreciated.
Thanks
Michael