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 - 2006-10-04 : 07:39:05
|
| sai writes "Hi,I have a query like thisselect sum(total) as app from f where f.file_id = g.file_id and f.wire = 1 and f.desc = 'app'like above query i have to select sum(total) for different descriptions.I want to keep all these in temp table and use those fields in main table.How do i do that?Iam new to SQLcan anybody help me.Thanks In Advance" |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2006-10-04 : 07:49:52
|
| You have to JOIN the g-column too.Peter LarssonHelsingborg, Sweden |
 |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2006-10-04 : 08:49:35
|
Like this??Select f.Desc, Sum(Total) as appinto #tempfrom f join gon f.file_id = g.file_idwhere f.wire = 1group by f.Desc Harsh AthalyeIndia."Nothing is Impossible" |
 |
|
|
|
|
|