jefftyzzer wrote:
> Friends:
>
> In v8 or v9 LUW, if I were to write (in Java or C) my own user-defined
> aggregate function, would I be able to use it in an OLAP windowing
> clause as I could use, e.g., COUNT or SUM?
>
> Example:
>
> SELECT
> JEFFS_UDAF() OVER(PARTITION BY SOME_COL)
> FROM
> SOME_TABLE;
There's no such thing as a user-defined aggregate function in DB2*,
external or otherwise, so no you couldn't use it with OLAP windowing
because it couldn't exist ;-)
Cheers,
Dave.
* Officially at least ... see Knut's fascinating dW article on a
possible implementation at:
http://www.ibm.com/developerworks/db2/library/techarticle/0309stolze/030
9stolze.html
Given that this relies on an existing aggregate function (MAX), I
suspect it /might/ work with OLAP windowing (though this depends on the
order of execution).


|