pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jeff Boes <jeff@endpoint.com>
To: Pgsql-sql@postgresql.org
Subject: Re: Breakdown results by month
Date: Thu, 04 Aug 2005 09:42:28 -0400
Message-ID: <42F21B44.1030505@endpoint.com> (raw)
In-Reply-To: <2bffcc3305080211342745b1ab@mail.gmail.com>
References: <2bffcc3305080211342745b1ab@mail.gmail.com>

Henry Ortega wrote:
> I have the ff table:
> 
> id       |    total    |     effective        |    end_date
> john          6              01-01-2005        02-28-2005
> john          8              03-01-2005        06-30-2005
> 
> How can I return:
> id       |    total    |     effective        |    end_date
> john          6              01-01-2005        01-31-2005
> john          6              02-01-2005        02-28-2005
> john          8              03-01-2005        03-31-2005
> john          8              04-01-2005        04-30-2005
> john          8              05-01-2005        05-31-2005
> john          8              06-01-2005        06-30-2005

I would look at writing a PL/PgSQL function that walks through the rows,
generating substitute rows for the dates you want.




view thread (4+ messages)  latest in thread

Message-ID: <42F21B44.1030505@endpoint.com>
Permalink:  ../42F21B44.1030505@endpoint.com/
Also on:    postgresql.org/message-id/42F21B44.1030505@endpoint.com

 · 

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: jeff@endpoint.com
  Subject: Re: Breakdown results by month
  In-Reply-To: <42F21B44.1030505@endpoint.com>

* 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