pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andreas <maps.on@gmx.net>
To: A. Kretschmer <andreas.kretschmer@schollglas.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Need magic for a moving statistic
Date: Fri, 02 Oct 2009 14:47:03 +0200
Message-ID: <4AC5F647.8030204@gmx.net> (raw)
In-Reply-To: <20091002052916.GA22496@a-kretschmer.de>
References: <4AC55231.2080008@gmx.net>
	<20091002052916.GA22496@a-kretschmer.de>


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.   :)





view thread (4+ messages)  latest in thread

Message-ID: <4AC5F647.8030204@gmx.net>
Permalink:  ../4AC5F647.8030204@gmx.net/
Also on:    postgresql.org/message-id/4AC5F647.8030204@gmx.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: maps.on@gmx.net, andreas.kretschmer@schollglas.com
  Subject: Re: Need magic for a moving statistic
  In-Reply-To: <4AC5F647.8030204@gmx.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox