Received: from mailo.vtcif.telstra.com.au (mailo.vtcif.telstra.com.au [202.12.144.17]) by hub.org (8.9.3/8.9.3) with ESMTP id VAA55047; Mon, 24 Jan 2000 21:44:22 -0500 (EST) (envelope-from chris@bitmead.com) Received: (from uucp@localhost) by mailo.vtcif.telstra.com.au (8.8.2/8.6.9) id NAA28484; Tue, 25 Jan 2000 13:43:50 +1100 (EST) Received: from maili.vtcif.telstra.com.au(202.12.142.17) via SMTP by mailo.vtcif.telstra.com.au, id smtpdX0iNR_; Tue Jan 25 13:43:28 2000 Received: (from uucp@localhost) by maili.vtcif.telstra.com.au (8.8.2/8.6.9) id NAA02996; Tue, 25 Jan 2000 13:43:27 +1100 (EST) Received: from localhost(127.0.0.1), claiming to be "mail.cdn.telstra.com.au" via SMTP by localhost, id smtpdwif71_; Tue Jan 25 13:42:44 2000 Received: from lunitari.nimrod.itg.telecom.com.au (lunitari.nimrod.itg.telecom.com.au [192.53.254.48]) by mail.cdn.telstra.com.au (8.8.2/8.6.9) with ESMTP id NAA13814; Tue, 25 Jan 2000 13:42:43 +1100 (EST) Received: from majere.design (majere [192.53.254.45]) by lunitari.nimrod.itg.telecom.com.au (8.9.1/8.9.3) with ESMTP id NAA20329; Tue, 25 Jan 2000 13:42:07 +1100 (EST) Received: from bitmead.com (localhost [127.0.0.1]) by majere.design (8.8.8+Sun/8.8.8) with ESMTP id NAA10782; Tue, 25 Jan 2000 13:41:25 +1100 (EST) Sender: chrisb@nimrod.itg.telstra.com.au Message-ID: <388D0D55.84F13203@bitmead.com> Date: Tue, 25 Jan 2000 13:41:25 +1100 From: Chris Bitmead Organization: IBM Global Services X-Mailer: Mozilla 4.6 [en] (X11; I; SunOS 5.6 sun4u) X-Accept-Language: en MIME-Version: 1.0 To: pgsql-hackers@postgreSQL.org, pgsql-sql@postgreSQL.org Subject: Re: [HACKERS] DISTINCT ON: speak now or forever hold your peace References: <2295.948765015@sss.pgh.pa.us> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Tom Lane wrote: > > If I don't hear loud hollers very soon, I'm going to eliminate the > DISTINCT ON "feature" for 7.0. As previously discussed, this feature > is not standard SQL and has no clear semantic interpretation. I don't feel overly strongly about this, but if I remember right you can do some pretty cool things with this feature, provided you do define some semantics clearly. Like I think you can find the first tuple (given some ORDER BY clause) that fulfills some criteria. I think it is SELECT DISTINCT ON name name, age ORDER BY age; will get the youngest person. This might not be clearly specified now, but as long as it's useful, how about clearly defining it? I don't know that there is an easy way of doing this in standard SQL. I don't see any problems with useful extensions to SQL. If people want standards, they don't have to use it.