Received: from wallace.ece.rice.edu (wallace.ece.rice.edu [128.42.12.154]) by hub.org (8.10.1/8.10.1) with ESMTP id e7HEcim87563 for ; Thu, 17 Aug 2000 10:38:44 -0400 (EDT) Received: by rice.edu via sendmail from stdin id (Debian Smail3.2.0.102) for pgsql-sql@hub.org; Thu, 17 Aug 2000 09:38:42 -0500 (CDT) Date: Thu, 17 Aug 2000 09:38:42 -0500 From: "Ross J. Reedstrom" To: pgsql-sql@hub.org Subject: Re: car mileage summation / sledgehammer method Message-ID: <20000817093842.A17023@rice.edu> Mail-Followup-To: pgsql-sql@hub.org References: <200008171159.e7HBxem98875@hub.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii User-Agent: Mutt/1.0i In-Reply-To: <200008171159.e7HBxem98875@hub.org>; from Maarten.Boekhold@reuters.com on Thu, Aug 17, 2000 at 01:55:19PM +0200 X-Archive-Number: 200008/157 On Thu, Aug 17, 2000 at 01:55:19PM +0200, Maarten Boekhold wrote: > > Now that's a bit stupid. Why create this view when you can do the same > thing with a table alias (I'm I calling this by the right name?). Now now, let's not call it stupid: how about 'not optimal'? > > select m.miles, m.date, sum(d.miles) from mileage m, mileage d > where....... > This is the traditional way to do a self join, yes. Ross -- Ross J. Reedstrom, Ph.D., NSBRI Research Scientist/Programmer Computer and Information Technology Institute Rice University, 6100 S. Main St., Houston, TX 77005