• dimpythewimpy (9/27/2016)


    Also, the reason I was unable to window function from the link above is, it does this:

    SUM(Col2) OVER(ORDER BY Col1 ROWS UNBOUNDED PRECEDING) "Rows" FROM #TMP

    basically adding just 2 columns but in my case i have multiple columns atleast 4 columns to add and a separate column to store result.

    Do you know if I can implement the same using window function approach. If so, can you please provide an example. Thanks

    You're confusing keywords and names. Col2 does not mean two columns, because Col2 is not a keyword. Col2 is the name for a single column. This would have been obvious if you had bothered to actually run the sample code.

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA