Received: from meryl.it.uu.se (meryl.it.uu.se [130.238.12.42]) by hub.org (8.9.3/8.9.3) with ESMTP id JAA10566; Fri, 26 May 2000 09:03:00 -0400 (EDT) (envelope-from e99re41@DoCS.UU.SE) Received: from Falk.DoCS.UU.SE (e99re41@Falk.DoCS.UU.SE [130.238.9.109]) by meryl.it.uu.se (8.8.5/8.8.5) with ESMTP id PAA18830; Fri, 26 May 2000 15:02:56 +0200 (MET DST) Received: from localhost (e99re41@localhost) by Falk.DoCS.UU.SE (8.6.12/8.6.12) with ESMTP id PAA12399; Fri, 26 May 2000 15:02:54 +0200 X-Authentication-Warning: Falk.DoCS.UU.SE: e99re41 owned process doing -bs Date: Fri, 26 May 2000 15:02:53 +0200 (MET DST) From: Peter Eisentraut Reply-To: Peter Eisentraut To: Tom Lane cc: Joseph Shraibman , "pgsql-sql@postgresql.org" , pgsql-hackers@postgresql.org Subject: Re: aliases break my query In-Reply-To: <5442.959315714@sss.pgh.pa.us> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from QUOTED-PRINTABLE to 8bit by hub.org id JAB16118 X-Archive-Number: 200005/157 > > playpen=> select ta.a,ta.b,ta.c, (select count (tb.zz) where tb.yy = > > ta.a) from tablea ta, tableb tb order by tablea.a; > [ produces 80 rows ] > > playpen=> select ta.a,ta.b,ta.c, (select count (tb.zz) where tb.yy = > > ta.a) from tablea ta, tableb tb order by ta.a; > [ produces 20 rows ] > > playpen=> select tablea.a,tablea.b,tablea.c, (select count (tableb.zz) > > where tableb.yy = tablea.a) order by tablea.a; > [ produces 4 rows ] Once again, I think that we *really* need to discuss whether implicit range table entries in SELECT are a good idea. We invariably get a question like this every week and invariably the answer is "if you give a table an alias you *must* refer to it by that alias". (I'm sure Tom has this reply automated by now.) I claim the only thing that buys is confusion for very little convenience at the other end. Stop the madness! :) -- Peter Eisentraut Sernanders väg 10:115 peter_e@gmx.net 75262 Uppsala http://yi.org/peter-e/ Sweden