Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: user defined aggregate functions

Re: user defined aggregate functions

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: 29 Aug 2001 18:13:27 -0700
Message-ID: <9mk3vn02e27@drn.newsguy.com>


In article <9a9a651.0108291629.3a3012f2_at_posting.google.com>, felixnaumann_at_hotmail.com says...
>
>Hi,
>
>is it possible to create user defined aggregate functions?
>
>Just to clarify and point out the difference to other
>posting in this group:
>- I do not mean scalar functions that do aggregation.
>- I do not mean work arounds such as those suggested for
> the PRODUCT aggregate function.
>
>For instance, I would like to submit a query
>
>SELECT isbn, RANDOM(title)
>FROM books
>GROUP BY isbn
>
>where RANDOM() returns a random title for each group
>of books.
>
>or
>
>SELECT title, CONCAT(description)
>FROM books
>GROUP BY title
>
>where CONCAT() concatenates all descriptions into
>one long description.
>
>Thanks for your help,
>Felix

in 9i -- yes
in 8i and before -- no

see

http://groups.google.com/groups?q=user+defined+aggregate+group:comp.databases.oracle.*+author:tkyte%40us.oracle.com&hl=en&safe=off&rnum=2&selm=9kugga018ue%40drn.newsguy.com

for a 9i example (it actually does your concat function).

--
Thomas Kyte (tkyte@us.oracle.com)             http://asktom.oracle.com/ 
Expert one on one Oracle, programming techniques and solutions for Oracle.
http://www.amazon.com/exec/obidos/ASIN/1861004826/  
Opinions are mine and do not necessarily reflect those of Oracle Corp 
Received on Wed Aug 29 2001 - 20:13:27 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US