pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Christoph Haller <ch@rodos.fzk.de>
To: pgsql-sql@postgresql.org
To: avsoledadjr@hotmail.com
Subject: Re: columnar format
Date: Tue, 08 Jul 2003 10:44:50 +0200
Message-ID: <3F0A8481.D9F01154@rodos.fzk.de> (raw)

>
> i would like to ask for the sql statement to the output:
>
> ITEM DESC   Jan   Feb   Mar  Apr  ...  Sep  Total
> xxxxxxxxxx   999  999  999  999  ...  999  9,999
>
> where "Jan" column is sum of all "x" items purchased on Jan, "Feb"
column as
> sum of Feb purchases, and so on up to "Sep", and "Total" as the total
from
> "Jan" to "Sep" (as in the case here). the numbers may/may not be
formatted,
> and the period varies, depending on the range.
>
Search the archives for pivot tables resp. crosstab and/or have a look
at
$PGSQLD/contrib/tablefunc/README.tablefunc
Regards, Christoph





view thread (2+ messages)

Message-ID: <3F0A8481.D9F01154@rodos.fzk.de>
Permalink:  ../3F0A8481.D9F01154@rodos.fzk.de/
Also on:    postgresql.org/message-id/3F0A8481.D9F01154@rodos.fzk.de

 · 

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: ch@rodos.fzk.de, avsoledadjr@hotmail.com
  Subject: Re: columnar format
  In-Reply-To: <3F0A8481.D9F01154@rodos.fzk.de>

* 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