Received: from thirstydog.dsl.net (thirstydog.dsl.net [65.84.81.4]) by postgresql.org (8.11.3/8.11.4) with ESMTP id fA1GmXP59809 for ; Thu, 1 Nov 2001 11:48:33 -0500 (EST) (envelope-from james@lrgmail.com) Received: from jameslt (65-85-235-195.client.dsl.net [65.85.235.195]) by thirstydog.dsl.net (Postfix) with SMTP id DD3F5191A9D; Thu, 1 Nov 2001 11:48:28 -0500 (EST) Message-ID: <007f01c162f5$d9a58ee0$1600000a@lrg.office> From: "James Orr" To: "Josh Berkus" , "Jeff Eckermann" , "Aasmund Midttun Godal" Cc: , References: Subject: Re: transposing data for a view Date: Thu, 1 Nov 2001 11:54:19 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 X-Archive-Number: 200111/16 X-Sequence-Number: 5402 > > BTW, I don't believe the self-join approach proposed > > earlier will work, because joining on "scanid" will > > create a cartesian type join where the region values > > will be duplicated (multiplicated!). > > Not if you're talking about my query, they won't. I use that query form > in many projects to create roll-ups; it's the "best" SQL92 approach to > the "pivot table" problem. However, it will not work in 7.0.3. I think he might be talking about mine. The region values will not be duplicated, the WHERE clause prevents it. I kind of prefer my own query aesthetically, is it as efficient internally? - James