Re: Need magic for a moving statistic - Mailing list pgsql-sql

From Andreas
Subject Re: Need magic for a moving statistic
Date
Msg-id 4AC5F647.8030204@gmx.net
Whole thread Raw
In response to Re: Need magic for a moving statistic  ("A. Kretschmer" <andreas.kretschmer@schollglas.com>)
Responses Re: Need magic for a moving statistic  ("A. Kretschmer" <andreas.kretschmer@schollglas.com>)
List 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.   :)




pgsql-sql by date:

Previous
From: "A. Kretschmer"
Date:
Subject: Re: right join problem
Next
From: "A. Kretschmer"
Date:
Subject: Re: Need magic for a moving statistic