aggregate functions are useful, e.g.:
select FinancialYear, PLFolder, Sum(PLDelta) SumDelta
from PL group by FinancialYear, PLFolder
however, sometimes I need do more complex calculation, such as, calculating the volatility.
This could be done by a User Defined Aggregate Function, programmed in C#, compiled as a CLR assembly, and then imported into MSSQL.
Is it possible to do it in pure T-SQL?