最有用的用户定义聚合函数

时间:2022-07-24 05:01:02

Do you have any aggregate functions that you have implemented because the standard ones were not good enough?

你有没有实现的聚合函数,因为标准函数不够好?

3 个解决方案

#1


3  

An aggregate function for SQL Server that produces a comma-separated list of values.

SQL Server的聚合函数,用于生成以逗号分隔的值列表。

Title
-----------------
The Hobbit
The Two Towers       -->   The Hobbit, The Two Towers, Leaf by Niggle
Leaf by Niggle

Here's my implementation: A SQL CLR user-defined aggregate - notes on creating and debugging

这是我的实现:SQL CLR用户定义的聚合 - 关于创建和调试的注释

#2


1  

Yes. In Oracle I've implemented a kind of group_concat because it is unavailable in Oracle. I've made a couple different versions which do a simple concat with comma-delimiting strings. Another does the same, only sorted. And there's another one that doesn't use a comma, but a special character so the results can be processed more easily when the values themselves might contain comma's too.

是。在Oracle中,我实现了一种group_concat,因为它在Oracle中不可用。我做了几个不同的版本,用逗号分隔字符串做一个简单的连接。另一个做同样的,只排序。而另一个不使用逗号,而是使用特殊字符,因此当值本身也可能包含逗号时,可以更轻松地处理结果。

#3


1  

  1. Weighted Average

  2. PercentAcross - This is the sum of X where a condition is true, divided by the sum of X.

    PercentAcross - 这是条件为真的X之和除以X的总和。

#1


3  

An aggregate function for SQL Server that produces a comma-separated list of values.

SQL Server的聚合函数,用于生成以逗号分隔的值列表。

Title
-----------------
The Hobbit
The Two Towers       -->   The Hobbit, The Two Towers, Leaf by Niggle
Leaf by Niggle

Here's my implementation: A SQL CLR user-defined aggregate - notes on creating and debugging

这是我的实现:SQL CLR用户定义的聚合 - 关于创建和调试的注释

#2


1  

Yes. In Oracle I've implemented a kind of group_concat because it is unavailable in Oracle. I've made a couple different versions which do a simple concat with comma-delimiting strings. Another does the same, only sorted. And there's another one that doesn't use a comma, but a special character so the results can be processed more easily when the values themselves might contain comma's too.

是。在Oracle中,我实现了一种group_concat,因为它在Oracle中不可用。我做了几个不同的版本,用逗号分隔字符串做一个简单的连接。另一个做同样的,只排序。而另一个不使用逗号,而是使用特殊字符,因此当值本身也可能包含逗号时,可以更轻松地处理结果。

#3


1  

  1. Weighted Average

  2. PercentAcross - This is the sum of X where a condition is true, divided by the sum of X.

    PercentAcross - 这是条件为真的X之和除以X的总和。