I have the following:
Select t0, t1,t2,t3,t4,sum(x1)as tx1,sum(x2)tx2
into tbl2 From Tbl1
Group by t0,t1,t2,t3,t4
Having (sum(x1)+sum(x2))> 10
trying to ungroup the above by flaging the tx column to 'Y':
update a set a.tx='Y'
from tbl1 a inner join tb2 b
on a.t0=bt0 and
a.t1=b.t1 and
a.t2=b.t2 and
a.t3=b.t3 and
a.t4=b.t4
select t0, t1,t2,t3,t4,x1,x2
into tbl3 from tbl1 where tx='Y'
trying to get these value to be the same:
select sum(tx1),sum(tx2) from tb2
select sum(x1), sumx(2) from tb3
However the sum for both table are different. Anyone have any suggestion?
thanks
Select t0, t1,t2,t3,t4,sum(x1)as tx1,sum(x2)tx2
into tbl2 From Tbl1
Group by t0,t1,t2,t3,t4
Having (sum(x1)+sum(x2))> 10
trying to ungroup the above by flaging the tx column to 'Y':
update a set a.tx='Y'
from tbl1 a inner join tb2 b
on a.t0=bt0 and
a.t1=b.t1 and
a.t2=b.t2 and
a.t3=b.t3 and
a.t4=b.t4
select t0, t1,t2,t3,t4,x1,x2
into tbl3 from tbl1 where tx='Y'
trying to get these value to be the same:
select sum(tx1),sum(tx2) from tb2
select sum(x1), sumx(2) from tb3
However the sum for both table are different. Anyone have any suggestion?
thanks