Patrik Hall writes:

> I am in need of median, quartile and percentile functions in postgres.
> 
> Has anybody implemented any of them allready?

Haven't heard, but if you can come up with a way to calculate them with a
single pass over the data rows (keeping several state variables, if
necessary) then you're half way there to implementing your own aggregate
function. See the Programmer's Guide on how that might be done.

Incidentally I couldn't think of a way to do just that. In that case it
will be *hard*.

-- 
Peter Eisentraut                  Sernanders väg 10:115
[EMAIL PROTECTED]                   75262 Uppsala
http://yi.org/peter-e/            Sweden


************

Reply via email to