Re: complex custom aggregate function

From: "Marc Mamin" <M(dot)Mamin(at)intershop(dot)de>
To: <m_lists(at)yahoo(dot)it>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: complex custom aggregate function
Date: 2009-01-30 20:49:03
Message-ID: C4DAC901169B624F933534A26ED7DF311F9BBB@JENMAIL01.ad.intershop.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


Oops,

I meant

group by floor(h_q-x)
instead of
group by (h_q-x)/1

Marc Mamin

> select H,A
> FROM
> (
> select min(h_q) as H, avg(x) as A
> group by h_q/1
> union all
> select min(h_q), avg(x)
> group by (h_q-0.25)/1
> union all
> select min(h_q), avg(x)
> group by (h_q-0.50)/1
> union all
> select min(h_q), avg(x)
> group by (h_q-0.75)/1
> )foo
> where A= select max(A) from (foo..)

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tony Caduto 2009-01-30 20:49:56 Re: PGSQL or other DB?
Previous Message Gregory Stark 2009-01-30 20:46:22 Re: Pet Peeves?