Received: from sss2.sss.pgh.pa.us (sss.pgh.pa.us [209.114.166.2]) by hub.org (8.9.3/8.9.3) with ESMTP id SAA27431; Wed, 26 Jan 2000 18:05:19 -0500 (EST) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss2.sss.pgh.pa.us (8.9.3/8.9.3) with ESMTP id SAA19437; Wed, 26 Jan 2000 18:05:08 -0500 (EST) To: Chris Bitmead cc: pgsql-hackers@postgreSQL.org, pgsql-sql Subject: Re: [HACKERS] Re: [SQL] DISTINCT ON: speak now or forever hold your peace In-reply-to: <388F7AE9.EDD10859@bitmead.com> References: <13995.948820606@sss.pgh.pa.us> <388F7AE9.EDD10859@bitmead.com> Comments: In-reply-to Chris Bitmead message dated "Thu, 27 Jan 2000 09:53:29 +1100" Date: Wed, 26 Jan 2000 18:05:08 -0500 Message-ID: <19434.948927908@sss.pgh.pa.us> From: Tom Lane Chris Bitmead writes: > As long as we're fixing the syntax, I'm wondering if it wouldn't be more > logical to have DISTINCT ON somewhere later in the syntax. Well, SELECT DISTINCT is that way because SQL92 says so. Putting the DISTINCT ON variant somewhere else might be logically purer, but I think it'd be confusing. Also, isn't the reason we have DISTINCT ON at all that it's there to be compatible with MySQL or someone? I figured adding parens would be about the least-surprising variant syntax for a person used to those other products. regards, tom lane