question

shaqee avatar image
0 Votes"
shaqee asked Yufeishao-msft commented

create user defined aggregate function with over (order by) clause

how could I create my own (via clr or other options) aggregate function that will have working "over (order by ...)" clause?

it was impossible in 2010 (https://social.msdn.microsoft.com/Forums/en-US/7f9a6990-072c-4867-b7d0-b0be70e4abb9/can-i-create-a-clr-ud-aggregate-function-with-over-order-by-clause?forum=sqlnetfx), but may be today we have this possibility?

sql-server-general
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

ErlandSommarskog avatar image
0 Votes"
ErlandSommarskog answered

No, nothing has changed in this regard. Overall, the CLR is an area where very little has happened since SQL 2008.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Yufeishao-msft avatar image
0 Votes"
Yufeishao-msft answered Yufeishao-msft commented

Hi @shaqee,

Yes, basically no change in this area.

From the official doc:SELECT - OVER Clause (Transact-SQL)

Depending on the ranking, aggregate, or analytic function used with the OVER clause, <ORDER BY clause> and/or the <ROWS and RANGE clause> may not be supported.


If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.





· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

If the reply above was helpful please mark as accepted answer so it can be helpful for other community members with same questions.

Regards

0 Votes 0 ·