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 - 2005-06-10 : 06:42:01
|
| Travis writes "Fair warning I am a rookie when it comes to sql..... Here is my situation, two tables, one with 6 columns(small table) and one with say 30+(big table). Smalll table and big table have a parent child relationship. Small table is expecting lots of searches and use. Big table with multiple records for each of small tables will be far far lighter. Save for one issue. I need to get the sum() of multiple records of big table and have them fill a field for each record of the small table.... My question is this. What is the best way to accomplish this situation. I was thinking a subQuery, but am not sure if thats more efficient than a join or a triger and static field. Oh and its very late so I hope this all makes sense... Thanks a bundle." |
|
|
nathans
Aged Yak Warrior
938 Posts |
|
|
JimL
SQL Slinging Yak Ranger
1537 Posts |
Posted - 2005-06-10 : 15:14:42
|
| I think this is what your afterSelect Smalltable.ID, Sum(largetable.column1) as whateverFrom Smalltable inner join largetable on Smalltable.ID = largetable.IDGroup by Smalltable.IDJimUsers <> Logic |
 |
|
|
|
|
|