Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The most useful User-Defined Aggregate Functions [closed]

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

like image 671
Lukasz Madon Avatar asked Dec 12 '10 12:12

Lukasz Madon


People also ask

Which aggregate functions are most commonly used?

Now it's time that we mention all T-SQL aggregate functions. The most commonly used are: COUNT – counts the number of elements in the group defined. SUM – calculates the sum of the given attribute/expression in the group defined.

What are aggregate functions How are they useful?

An aggregate function is a mathematical computation involving a range of values that results in just a single value expressing the significance of the accumulated data it is derived from. Aggregate functions are often used to derive descriptive statistics.

Which is used with an aggregate functions?

An aggregate function can be used in a WHERE clause only if that clause is part of a subquery of a HAVING clause and the column name specified in the expression is a correlated reference to a group. If the expression includes more than one column name, each column name must be a correlated reference to the same group.

What are the 5 aggregate functions?

There are five aggregate functions, which are: MIN, MAX, COUNT, SUM, and AVG.


1 Answers

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

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

like image 85
Marek Grzenkowicz Avatar answered Sep 23 '22 23:09

Marek Grzenkowicz