Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id B104B9FB3E7 for ; Sun, 17 Jun 2007 12:54:50 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 88393-10 for ; Sun, 17 Jun 2007 12:54:46 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from main2.mycybernet.net (main2.mycybernet.net [209.222.63.140]) by postgresql.org (Postfix) with ESMTP id 4C9899FB2B9 for ; Sun, 17 Jun 2007 12:54:47 -0300 (ADT) Received: from 227-54-222-209.mycybernet.net ([209.222.54.227] helo=phlogiston.dydns.org) by main2.mycybernet.net with esmtp (Exim 4.62) (envelope-from ) id 1Hzx5S-0002bg-M9 for pgsql-sql@postgresql.org; Sun, 17 Jun 2007 11:54:46 -0400 Received: by phlogiston.dydns.org (Postfix, from userid 1000) id 5D4CE3F9E; Sun, 17 Jun 2007 11:54:41 -0400 (EDT) Date: Sun, 17 Jun 2007 11:54:41 -0400 From: Andrew Sullivan To: pgsql-sql@postgresql.org Subject: Re: joining a table whose name is stored in the primary record Message-ID: <20070617155441.GB13671@phlogiston.dyndns.org> References: <4674F357.5040409@bucksvsbytes.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4674F357.5040409@bucksvsbytes.com> User-Agent: Mutt/1.5.9i X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200706/119 X-Sequence-Number: 28609 On Sun, Jun 17, 2007 at 04:39:51AM -0400, John Gunther wrote: > functions and using subqueries without success. I think I need someone > to point me in the right conceptual direction. Well, the right SQL-esque conceptual direction is not to have different tables at all. That's not a very normal-form thing to do, because the data has been broken into pieces dependent on the data itself, rather than the kind of data it is. A -- Andrew Sullivan | ajs@crankycanuck.ca In the future this spectacle of the middle classes shocking the avant- garde will probably become the textbook definition of Postmodernism. --Brad Holland