Re: Need magic for a moving statistic

From: Andreas <maps(dot)on(at)gmx(dot)net>
To: "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Need magic for a moving statistic
Date: 2009-10-02 12:47:03
Message-ID: 4AC5F647.8030204@gmx.net
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-sql


A. Kretschmer schrieb:
> [...] Or simpler:
>
> test=*# select ((d-'2009-10-02'::date)/14) || '. period' as period, sum(value) from foo group by 1;
>
This is tricky, because you use a text-column to sort but need numerical
sorting since there will be more than 0-9 periods.

This is still the way to handle the periodity without pulling out some
external skript language.
Thanks for the reply. :)

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message A. Kretschmer 2009-10-02 13:10:36 Re: Need magic for a moving statistic
Previous Message A. Kretschmer 2009-10-02 06:36:06 Re: right join problem