Viewing 2 posts - 1 through 2 (of 2 total)
Even more efficient for the test data supplied is this one - almost 9 times faster than the original -- look at the execution plan of the batch when you...
April 11, 2012 at 9:08 am
#1471943
A much more efficient version of this takes about 1/6 of the processing:
SELECT G.OrderDate, G.ProductKey, QtyOrdered = SUM(F.QtyOrdered), G.MTD
FROM
(
SELECT
...
April 11, 2012 at 8:47 am
#1471908