Re: Generating a cross tab (pivot table)

From: Ludwig Lim <lud_nowhere_man(at)yahoo(dot)com>
To: Christoph Haller <ch(at)rodos(dot)fzk(dot)de>
Cc: PostgreSQL Mailing List <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Generating a cross tab (pivot table)
Date: 2002-11-08 09:39:32
Message-ID: 20021108093932.41983.qmail@web80313.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


--- Christoph Haller <ch(at)rodos(dot)fzk(dot)de> wrote:
> It's obvious this approach is most inflexible.
> As soon as there is a new vendor, one has to
> re-write the query and add
> SUM(CASE vendor WHEN 'mr. new' THEN ... ,
>

> In an advanced example it is shown how to deal with
> cross tabs in
> general
> using a stored procedure. I am going to translate
> this and re-write it
> for postgres, too (ok, I will try).

I saw something that might somewhat a bit more
flexible solution using SQL. I don't know it it work
in PostgreSQL. I saw it at the MySQL site.

The following is the URL:
http://www.mysql.com/articles/wizard/index.html

Has anyone tried this on a PostgreSQL database ?

regards,
ludwig

__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Christoph Haller 2002-11-08 10:01:13 Re: query optimization question
Previous Message Christoph Haller 2002-11-08 09:06:10 Re: PLpgSQL FOR IN EXECUTE question