Received: from eclipse.pacifier.com (eclipse.pacifier.com [199.2.117.78]) by hub.org (8.9.3/8.9.3) with ESMTP id KAA89867 for ; Tue, 25 Jan 2000 10:44:42 -0500 (EST) (envelope-from dhogaza@pacifier.com) Received: from desktop (dsl-dhogaza.pacifier.net [216.65.147.68]) by eclipse.pacifier.com (8.9.3/8.9.3pop) with SMTP id HAA13917; Tue, 25 Jan 2000 07:43:56 -0800 (PST) Message-Id: <3.0.1.32.20000125074138.00f752c0@mail.pacifier.com> X-Sender: dhogaza@mail.pacifier.com X-Mailer: Windows Eudora Pro Version 3.0.1 (32) Date: Tue, 25 Jan 2000 07:41:38 -0800 To: Philip Warner , Tom Lane From: Don Baccus Subject: Re: [HACKERS] DISTINCT ON: speak now or forever hold your peace Cc: Chris Bitmead , pgsql-hackers@postgreSQL.org In-Reply-To: <3.0.5.32.20000125170026.0357d8f0@mail.rhyme.com.au> References: <3.0.1.32.20000124212022.00f70720@mail.pacifier.com> <11879.948776470@sss.pgh.pa.us> <3.0.5.32.20000125150557.036121c0@mail.rhyme.com.au> <2295.948765015@sss.pgh.pa.us> <3.0.5.32.20000125140349.035768d0@mail.rhyme.com.au> <3.0.5.32.20000125150557.036121c0@mail.rhyme.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" At 05:00 PM 1/25/00 +1100, Philip Warner wrote: >Out of curiosity, does the SQL spec give any rules or guidelines about when >aggregates should be applied to resultant rows? Or is it one of the >implementation-dependant things? Well...my copy of Date's now actually in the mail, rather than in Boston, but at the moment that's not much help! "order by" happens after everything, AFAIK. For instance... select ... union select ... order by orders the result of the union, which pretty much implies that aggregates will happen first. - Don Baccus, Portland OR Nature photos, on-line guides, Pacific Northwest Rare Bird Alert Service and other goodies at http://donb.photo.net.