How to get data in temp table and then copy it to another table in SQL Server

How to copy data from temp table in SQL server 2008?


with MovieSlice as          
(          
      select moviestock.moviesuffix,count(moviesongs.id_song) as songsCount from moviestock
inner join moviesongs on moviestock.moviesuffix = moviesongs.moviesuffix
group by moviestock.moviesuffix    
)    

UPDATE
    MovieStock
SET
    MovieStock.songsCount = MovieSlice.songsCount
FROM
    MovieStock
INNER JOIN
    MovieSlice
ON
    MovieSlice.moviesuffix = MovieStock.moviesuffix

Comments

Popular Posts

GREYCstoration Oil Paint plugin for Photoshop

Apple iPhone sending SMS automatically 00447786205094

SharePoint online hub navigation not updating for other users

Service Bus Gateway service stuck at Starting

RangeError: Maximum call stack size exceeded | Node JS | SPFX React