X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 012C45E46D5 for ; Tue, 17 Aug 2004 06:48:45 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 90117-08 for ; Tue, 17 Aug 2004 09:48:39 +0000 (GMT) Received: from anchor-post-37.mail.demon.net (anchor-post-36.mail.demon.net [194.217.242.86]) by svr1.postgresql.org (Postfix) with ESMTP id 3F6E05E46D3 for ; Tue, 17 Aug 2004 06:48:37 -0300 (ADT) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-37.mail.demon.net with esmtp (Exim 3.35 #1) id 1Bx0a6-0009Jq-0b; Tue, 17 Aug 2004 09:48:39 +0000 Received: from [192.168.1.17] (client17.archonet.com [192.168.1.17]) by mainbox.archonet.com (Postfix) with ESMTP id 5DCC918226; Tue, 17 Aug 2004 10:48:37 +0100 (BST) Message-ID: <4121D475.3070804@archonet.com> Date: Tue, 17 Aug 2004 10:48:37 +0100 From: Richard Huxton User-Agent: Mozilla Thunderbird 0.7 (X11/20040615) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Theo Galanakis Cc: "'pgsql-sql@postgresql.org'" Subject: Re: CROSS-TAB query help? I have read it cant be done in on References: <82E30406384FFB44AFD1012BAB230B55037D0510@shiva.au.lpint.net> In-Reply-To: <82E30406384FFB44AFD1012BAB230B55037D0510@shiva.au.lpint.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200408/156 X-Sequence-Number: 18653 Theo Galanakis wrote: > Thanks Rickard > Max may not work as not all the data is numerical. However I will give the > contrib/cross-tab a go! It will work as long as you only have one non-null value per grouped field (which you did in your example). >>| symbol | linktype >>-------------------+------+------+-------------------+-----------+---- >>-------------------+------+------+-------------------+-----------+---- >>-------------------+------+------+-------------------+-----------+-- >> 100473 | 93 | | | | >> 100473 | | 77 | | | >> 100473 | | | text1 | | -- Richard Huxton Archonet Ltd