Re: [HACKERS] DISTINCT ON: speak now or forever hold your peace

From: Don Baccus <dhogaza(at)pacifier(dot)com>
To: Philip Warner <pjw(at)rhyme(dot)com(dot)au>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Chris Bitmead <chris(at)bitmead(dot)com>, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] DISTINCT ON: speak now or forever hold your peace
Date: 2000-01-25 15:41:38
Message-ID: 3.0.1.32.20000125074138.00f752c0@mail.pacifier.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-sql

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 <dhogaza(at)pacifier(dot)com>
Nature photos, on-line guides, Pacific Northwest
Rare Bird Alert Service and other goodies at
http://donb.photo.net.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Don Baccus 2000-01-25 15:53:53 Re: [HACKERS] Happy column dropping
Previous Message Hiroshi Inoue 2000-01-25 15:40:00 RE: [HACKERS] Sure enough, SI buffer overrun is broken

Browse pgsql-sql by date

  From Date Subject
Next Message Palle Girgensohn 2000-01-25 16:03:05 Re: [SQL] Duplicate tuples with unique index
Previous Message Julian Scarfe 2000-01-25 13:23:58 Re: [SQL] DISTINCT ON: speak now or forever hold your peace