Re: complex custom aggregate function - Mailing list pgsql-general

From Marc Mamin
Subject Re: complex custom aggregate function
Date
Msg-id C4DAC901169B624F933534A26ED7DF311F9BBB@JENMAIL01.ad.intershop.net
Whole thread Raw
In response to Re: complex custom aggregate function  (Scara Maccai <m_lists@yahoo.it>)
List 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..)

pgsql-general by date:

Previous
From: Tony Caduto
Date:
Subject: Re: PGSQL or other DB?
Next
From: rhubbell
Date:
Subject: Re: Pet Peeves?