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.
| Author |
Topic |
|
aidmondo
Starting Member
23 Posts |
Posted - 2012-05-25 : 08:24:49
|
| Create table tableA (tableAID int identity(1,1), Column2 varchar(200), Column3 money)Create table tableB (tableBID int identity, tableAID int foreign Key(#above), Thirdcolumn int)Create table tableC (tableCID int identity, tableBID int foreign key (#above), tableCNo int)tableCNo = Column3(#from tableA) + Thirdcolumn(#fromtableB). Helpaidmondo |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2012-05-25 : 08:27:42
|
There is no relation between tableC and the other tables. No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-05-25 : 09:42:54
|
| [code]UPDATE cSET tableCNo = COALESCE(a.Column3,0) + COALESCE(b.Thirdcolumn ,0)FROM tableC cINNER JOIN tableB bON b.tableBID = c.tableBID INNER JOIN tableA aON a.tableAID = b.tableAID [/code]------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2012-05-25 : 10:01:15
|
ok - NOWS there is a relation  No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
|
|
|