Re: crosstab

From: Aram Fingal <fingal(at)multifactorial(dot)com>
To: Postgres-General General <pgsql-general(at)postgresql(dot)org>
Subject: Re: crosstab
Date: 2012-09-04 19:17:36
Message-ID: 73FF0C6A-965B-4456-BA90-2B8FD1CBC118@multifactorial.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sep 4, 2012, at 2:51 PM, Vincent Veyron wrote:

> Le mardi 04 septembre 2012 à 08:39 -0700, punnoose a écrit :
>> hi all
>> How could i use crostab to display variable number of columns. in the output
>> There could be variable number of columns
>
> see the documentation for Additional Supplied Modules, in your case
> tablefunc :
>
> http://www.postgresql.org/docs/9.1/static/tablefunc.html

I evaluated tablefunc about a year and a half ago and found that it was not what I wanted because you have to explicitly list what you want the columns to be. In some cases, there will be hundreds of columns in the pivoted table. The Reshape library in R can pivot tables without you even knowing ahead of time how many columns there are going to be. Maybe I need to revisit the documentation in case I missed something or if new functionality has been added since I last looked.

-Aram

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Joe Conway 2012-09-04 19:26:21 Re: crosstab
Previous Message dinesh kumar 2012-09-04 19:01:12 Re: crosstab