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
 General SQL Server Forums
 New to SQL Server Programming
 [SOLVED] 1 row table.

Author  Topic 

vtxvtx
Starting Member

18 Posts

Posted - 2012-08-23 : 04:07:53
I'm sure this is a very simple solution, but i cant seem to get it to work.

I start with an empty table with 1 column (sales)

i want to run a select on another table that returns the count of rows (i have that done) and then insert this value into that column.

i'll then want to run a similar select statement but insert that into a 2nd column.

ive been trying something along the lines of the below, but it contains an error at the moment,

Update Tbl2 
Set Sales = foo
from
(select count(MWD.dbo.Tbl1.ID)as foo
From
MWD.dbo.Tbl1) as TempTbl

vtxvtx
Starting Member

18 Posts

Posted - 2012-08-23 : 04:10:39
Managed to fix this already, just neeeded to make a row in the column to start with.

Thanks,
Andy
Go to Top of Page
   

- Advertisement -