I am trying to use the Rows between unbounded preceeding... method as per how to get cumulative sum
I am running MS Server 2012.
The query is using a table created in a CTE [tbl2]:
SELECT [RowID]
, [GroupID]
, [NumericalData]
, Sum([NumericalData])
Over (Partition By [GroupID]
order by [RowID]
ROWS between UNBOUNDED PRECEDING and CURRENT ROW) as Cumulative
FROM TBL2
GROUP BY [ROWid]
, [groupID]
, [NumericalData]
Order By ROW
I get the following error message: Msg 102, Level 15, State 1, Line 103 Incorrect syntax near 'ROWS'.
Any one know what I am doing wrong?
Thanks in advance