Re: dynamic columns in a query

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Jyoti Seth <jyotiseth2001(at)gmail(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: dynamic columns in a query
Date: 2009-06-11 08:54:39
Message-ID: 162867790906110154t7e555899h5fbc006266f7e708@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hello

2009/6/11 Jyoti Seth <jyotiseth2001(at)gmail(dot)com>:
> Hi All,
>
> Is there any way in postgres to write a query to display the result in
> matrix form. (where column names are dynamic)
>

look on http://okbob.blogspot.com/2008/08/using-cursors-for-generating-cross.html

regards
Pavel Stehule

> For eg.
>
>
> Employee Name   Client1 Client2 Client3 Client4
> Emp1                    100             102             90              23
> Emp2                    56              0               23              98
> Emp3                    34              45              76              0
>
>
> Here Client1, Client2... are the values from the database.
>
> Thanks,
> Jyoti
>
>
>
> --
> Sent via pgsql-sql mailing list (pgsql-sql(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-sql
>

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Rob Sargent 2009-06-11 16:05:39 Re: Avoiding "will create implicit index" NOTICE
Previous Message A. Kretschmer 2009-06-11 07:53:41 Re: dynamic columns in a query