• The example is using "ROWS BETWEEN CURRENT ROW AND 1 FOLLOWING". Just two values are possible, so why are you adding three values?

    -- wrong

    280 1 1,352,577.13 2005 4502152.27 (1,352,577.13+1,573,012.94+1,576,562.20)=>different conclusion

    283 1 1,573,012.94 2005 4502152.27 (1,352,577.13+1,573,012.94+1,576,562.20)=>different conclusion

    284 1 1,576,562.20 2006 1,576,562.20 (1,576,562.20+0)

    280 1 1,352,577.13 2005 (current 1,352,577.13 + next in the partition / order 1,573,012.94)

    283 1 1,573,012.94 2005 (current 1,573,012.94 + next in the partition / order 1,576,562.20)

    284 1 1,576,562.20 2006 (current 1,576,562.20 because there is no next in the partition / order)

    The partition is by TerritoryID and the order is by year. Since territoryid = 1 has two rows with same value for the year then the ordering is not deterministic and it is possible that next time you execute the query the result could be different. To break ties they should have added a column like BusinessEntityID to the order, as you did in the ORDER BY clause.