Home Forums SQL Server 2005 SQL Server 2005 Performance Tuning Need high resource expensive sql queries RE: Need high resource expensive sql queries
Madhivanan-208264
SSCertifiable
Points: 7516
More actions
September 7, 2010 at 6:45 am
#1217285
Have a million row table and do running total using a triangular join
select col,
(select sum(col) from table as t1 where t1.pkcol<=t2.pkcol) as run_sum
from table as t2
Failing to plan is Planning to fail