Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Writing aggregate functions in stored functions?
9i lets you code your own aggregate functions. Not sure if that's what you're asking, since the ones you cite (other than median) are built-ins.
If you want to get MIN etc. for subsets of the data, you can use the OVER( ) clause. The syntax inside OVER( ) varies, but with a simple GROUP BY it would be something like "MIN(sal) OVER( PARTITION BY DEPT_NO )". John
On Fri, 27 Jul 2001 00:00:36 -0700, "Jerzy Tomasik" <tomasik_at_datapacket.net> wrote:
>Is it possible to develop an aggregate function (e.g. SUM, AVG, MAX, MIN)
>as a stored function (or any other way). I would like to be able to perform
>queries like:
>
>SELECT dept_no, MIN(sal), MEDIAN(sal), MAX(sal) FROM EMP
>GROUP BY dept_no;
>
>TIA,
>Jerzy
>
>
>
-- Got an Oracle database question? Try the search engine for the database docs at: http://tahiti.oracle.com/Received on Fri Jul 27 2001 - 05:48:55 CDT
![]() |
![]() |