nolan@celery.tssi.com writes:
> wouldn't the easiest way to offer both sample and population formulas for
> variance and standard deviation be to just add two new functions,
> varp and stddevp, most of the code for which already exists?
As Joe pointed out, SQL200x seems to have laid down the law already on
what to call these things.
> That way they remain single-input aggregates.
My comment about multiple inputs was in response to the suggestion of
grouped input, which I took to mean that you'd want to write something
like "SELECT STDDEV_GROUPED(value, num_occurrences) FROM foo".
You could hack your way around the problem by defining the aggregate
to take a two-element array type:
SELECT STDDEV_GROUPED(ARRAY[value, num_occurrences]) FROM foo
but this seems ugly and inefficient.
regards, tom lane