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 |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2001-07-25 : 14:44:41
|
| David writes "I am looking for a stored proc to return the sum of results from 3 tables. I'll explain the table structure first. Table1:Table1IDintField1bitField1 Table2:Table2IDintField2bitField2Table1ID Table3:Table3IDintField3bitField3Table2ID There is a one to many join between Table1 and Table2, and another between Table2 and Table3. The Fields that are called bitField* store a 1 or 0. The Fields intField* are int. What I want is to get the sum of all the values for intField2 and intField3 for each record in Table1. The bitField* fields act as a 'switch'. If they are 1 I don't want to include them in the sum." |
|
|
|
|
|