• Steve Jones - SSC Editor (12/20/2013)


    You would use unbounded preceding for all the rows. The title did say all the rows, but the question did not.

    Steve, that's special pleading. LAG references a single row. the question says "those rows ...", not "a row ...". It also talks about an aggregate, and it's a bit odd to think of an aggregate applying to a single row. Can you give a sensible example of how LAG can be used to cause an aggregate to apply to rows (as opposed to a row)?

    Tom