• If I read this correctly, you just implemented the LAG(...) Over(...) analytic function.

    However, I'm interested... if you do this on a large dataset, what does the execution plan look like?

    Random Technical Stuff[/url]