Skip site navigation (1) Skip section navigation (2)

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

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Julian Scarfe <jscarfe(at)callnetuk(dot)com>, pgsql-hackers(at)postgreSQL(dot)org, pgsql-sql <pgsql-sql(at)postgreSQL(dot)org>
Subject: Re: [HACKERS] Re: [SQL] DISTINCT ON: speak now or forever hold your peace
Date: 2000-01-25 22:35:32
Message-ID: 200001252235.RAA25711@candle.pha.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-sql
> (BTW, ordinary SELECT DISTINCT has this same sort of problem if you try
> to ORDER BY an expression that doesn't appear in the target list.
> SQL92 avoids the issue by not allowing you to ORDER BY expressions that
> aren't in the target list, period.  We do allow that --- but not when
> you use DISTINCT.  Essentially, I want to enforce that same restriction
> for DISTINCT ON.)
> 
> The other piece of the puzzle would be to document that DISTINCT ON
> keeps the first tuple out of each set with the same DISTINCT ON value.
> 
> Does that sound like a plan?

Yes, very clear.  Good.

-- 
  Bruce Momjian                        |  http://www.op.net/~candle
  pgman(at)candle(dot)pha(dot)pa(dot)us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

In response to

pgsql-hackers by date

Next:From: Bruce MomjianDate: 2000-01-25 22:38:22
Subject: Re: Happy column adding (was RE: [HACKERS] Happy column dropping)
Previous:From: Don BaccusDate: 2000-01-25 21:57:15
Subject: Re: Happy column adding and dropping

pgsql-sql by date

Next:From: sejDate: 2000-01-25 23:33:43
Subject: rachel.jpg
Previous:From: Bruce MomjianDate: 2000-01-25 20:08:46
Subject: Re: [SQL] Duplicate tuples with unique index

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group