Michael writes:
> Umm does this mean there is no way to do what I need? Is it inappropiate
> to ask if it'd be difficult for such a function to be added into MySQL if
> it is the case that this is an impossible thing to do (or even just very
> challenging)? A median is a very common function to need in accounting I
> think. Thanks.
> 
> 
> *^*^*^*
> Michael McGlothlin <[EMAIL PROTECTED]>
> http://mlug.missouri.edu/~mogmios/projects/


No, it is very easy to do.

Add it as an UDF. This will not work on server running on  Windows,
though.

Take a look at udf_example.cc in sql/ subdir of the source. Most
notably, analyse :

 CREATE AGGREGATE FUNCTION avgcost RETURNS REAL SONAME "udf_example.so";

-- 
Regards,
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Mr. Sinisa Milivojevic <[EMAIL PROTECTED]>
 / /|_/ / // /\ \/ /_/ / /__   MySQL AB, Fulltime Developer
/_/  /_/\_, /___/\___\_\___/   Larnaca, Cyprus
       <___/   www.mysql.com


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to