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 |
|
hai
Yak Posting Veteran
84 Posts |
Posted - 2007-12-20 : 16:09:19
|
| I have the following: Select t0, t1,t2,t3,t4,sum(x1)as tx1,sum(x2)tx2From Tbl1Group by t0,t1,t2,t3,t4Having (sum(x1)+sum(x2))> 10trying to ungroup the above, which when add a.x1 all togetherthey should = tx1 above but it is not. Can someone point to me what I'm missing?thanksselect a.t0,a.t1,a.t2,a.t3,a.t4,a.x1,a.x2from Tbl1 a inner join (select t0,t1,t2,t3,t4 from Tbl1)bon a.t0=bt0 anda.t1=b.t1 anda.t2=b.t2 and a.t3=b.t3 anda.t4=b.t4 |
|
|
|
|
|
|
|