Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 54EF84764F0 for ; Fri, 8 Nov 2002 04:39:31 -0500 (EST) Received: from web80313.mail.yahoo.com (web80313.mail.yahoo.com [66.218.79.29]) by postgresql.org (Postfix) with SMTP id 7F36447645A for ; Fri, 8 Nov 2002 04:39:30 -0500 (EST) Message-ID: <20021108093932.41983.qmail@web80313.mail.yahoo.com> Received: from [203.87.150.116] by web80313.mail.yahoo.com via HTTP; Fri, 08 Nov 2002 01:39:32 PST Date: Fri, 8 Nov 2002 01:39:32 -0800 (PST) From: Ludwig Lim Subject: Re: Generating a cross tab (pivot table) To: Christoph Haller Cc: PostgreSQL Mailing List In-Reply-To: <3DCA52E2.5529E893@rodos.fzk.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200211/133 X-Sequence-Number: 10275 --- Christoph Haller 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