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 |
|
sam_sh
Starting Member
4 Posts |
Posted - 2009-10-07 : 15:14:03
|
| HiI have 3 tables: T1 ID Name ------- 1 A 2 B T2ID Date p-------------------1 2008/01/02 20 2 2009/05/15 15 T12IDT1 IDT2 d-------------1 1 71 2 52 2 32 2 8result between 2 date :Name d*p as expr1-------------------------A (7*20)+(5*15)=215B (3*20)+(8*15)=180thanks |
|
|
TG
Master Smack Fu Yak Hacker
6065 Posts |
|
|
matrixmind
Starting Member
9 Posts |
Posted - 2009-10-30 : 02:56:42
|
quote: Originally posted by sam_sh HiI have 3 tables: T1 ID Name ------- 1 A 2 B T2ID Date p-------------------1 2008/01/02 20 2 2009/05/15 15 T12IDT1 IDT2 d-------------1 1 71 2 52 2 32 2 8result between 2 date :Name d*p as expr1-------------------------A (7*20)+(5*15)=215B (3*20)+(8*15)=180thanks
with abcas(select IDT1,IDT2,D,PFrom TC1TC2 PC inner join CT2 C2on C2.ID=PC.IDT2)select Sum(D*P) as [Exp1],CT1.Name from abc inner join CT1 on CT1.ID=Abc.IDT1Group by CT1.NameDinesh SharmaMatrix SolutionSr.Software Engg. |
 |
|
|
|
|
|