Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id B272D63305F for ; Thu, 11 Jun 2009 04:48:42 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 24793-02 for ; Thu, 11 Jun 2009 04:48:35 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from wf-out-1314.google.com (wf-out-1314.google.com [209.85.200.170]) by mail.postgresql.org (Postfix) with ESMTP id EF753632637 for ; Thu, 11 Jun 2009 04:48:38 -0300 (ADT) Received: by wf-out-1314.google.com with SMTP id 28so483372wfc.28 for ; Thu, 11 Jun 2009 00:48:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:references :in-reply-to:subject:date:message-id:mime-version:content-type :content-transfer-encoding:x-mailer:thread-index:content-language :x-cr-hashedpuzzle:x-cr-puzzleid; bh=Ik4aWYk9BN7Nsg+P2lYUAu7xvXgTqv5UKBUd1WGIkL8=; b=HvKwAAs8K2ip4rBjUi/ZFQ0E33SQq5YiptEV6E3zyy+SIUXvAABDvGnuHvXtcqa9t4 2so8qq0tOwSh5hoa2XS6cFLo+w35GizdJAWgYzkBPAv8drnzo2MG6Y5NP/j5rLM4LZ38 J3LM5FWiX5z+WIJlyuA+J4v9yo6X5roakMamI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:references:in-reply-to:subject:date:message-id:mime-version :content-type:content-transfer-encoding:x-mailer:thread-index :content-language:x-cr-hashedpuzzle:x-cr-puzzleid; b=EJONQT7Lgg51AJOj6AQJJZH1HrTeHNcL/BhG0+0AQkUSeHYDz1uo5pq3f2IdHtmPN8 RKrtRWLEhaa/ocKfui1RW8ob4ZY0MPBZvSTL65U1ndhFlCONK89Y2Rl4876sE5zc2xva 5iR+aNwBC13fBwGMBbtPpgJtgWAGaVDEU8qVc= Received: by 10.143.18.21 with SMTP id v21mr1003555wfi.148.1244706517734; Thu, 11 Jun 2009 00:48:37 -0700 (PDT) Received: from BITDLLT03 ([122.160.72.188]) by mx.google.com with ESMTPS id 22sm61739wfg.7.2009.06.11.00.48.35 (version=SSLv3 cipher=RC4-MD5); Thu, 11 Jun 2009 00:48:37 -0700 (PDT) From: "Jyoti Seth" To: References: <200906100519.34171.jfabiani@yolo.com> In-Reply-To: <200906100519.34171.jfabiani@yolo.com> Subject: dynamic columns in a query Date: Thu, 11 Jun 2009 13:12:06 +0530 Message-ID: <000001c9ea68$217cb890$647629b0$@com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcnpxcUEgCGBjxkuRx+p1F8u8dqN0QAoVt6Q Content-Language: en-us x-cr-hashedpuzzle: AJTd AKrg Any1 At0U BE2L CJl2 CX87 DRyk De3Q EA5P Eszn FeWb GxHc H8Wj IY8i Ih3a; 1; cABnAHMAcQBsAC0AcwBxAGwAQABwAG8AcwB0AGcAcgBlAHMAcQBsAC4AbwByAGcA; Sosha1_v1; 7; {3E28894B-5D4F-4AA7-8C01-F3F0BEBCE491}; agB5AG8AdABpAHMAZQB0AGgAMgAwADAAMQBAAGcAbQBhAGkAbAAuAGMAbwBtAA==; Thu, 11 Jun 2009 07:42:01 GMT; ZAB5AG4AYQBtAGkAYwAgAGMAbwBsAHUAbQBuAHMAIABpAG4AIABhACAAcQB1AGUAcgB5AA== x-cr-puzzleid: {3E28894B-5D4F-4AA7-8C01-F3F0BEBCE491} X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200906/51 X-Sequence-Number: 32656 Hi All, Is there any way in postgres to write a query to display the result in matrix form. (where column names are dynamic) 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