public inbox for [email protected]
help / color / mirror / Atom feedFrom: Tom Lane <[email protected]>
To: David G. Johnston <[email protected]>
Cc: John Lumby <[email protected]>
Cc: [email protected] <[email protected]>
Subject: Re: description of Aggregate Expressions
Date: Thu, 05 Dec 2019 18:29:34 -0500
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAKFQuwZk3Kt4uNktMgLYj5B1Rzrm1R4EMVZQRka189AhnPkM=Q@mail.gmail.com>
References: <2A91BEF8171A5349931391E0C721CC5375705457@CPEMS-KPN501.KPNCNL.LOCAL>
<[email protected]>
<2A91BEF8171A5349931391E0C721CC53757054D3@CPEMS-KPN501.KPNCNL.LOCAL>
<[email protected]>
<[email protected]>
<[email protected]>
<2A91BEF8171A5349931391E0C721CC5375705528@CPEMS-KPN501.KPNCNL.LOCAL>
<[email protected]>
<2A91BEF8171A5349931391E0C721CC53757055C3@CPEMS-KPN501.KPNCNL.LOCAL>
<DM6PR06MB55622DFEE2755236B8A810A0A35C0@DM6PR06MB5562.namprd06.prod.outlook.com>
<CAKFQuwZk3Kt4uNktMgLYj5B1Rzrm1R4EMVZQRka189AhnPkM=Q@mail.gmail.com>
"David G. Johnston" <[email protected]> writes:
> On Thu, Dec 5, 2019 at 3:18 PM John Lumby <[email protected]> wrote:
>> whereas
>> select count(DISTINCT ( parent_id , name) ) from mytable
>> is accepted.
> Correct, converting the two individual columns into a "tuple" allows the
> default tuple distinct-making infrastructure to be used to execute the
> query.
Yeah. This might be more intelligible if it were written
select count(DISTINCT ROW(parent_id, name) ) from mytable
However, the SQL committee in their finite wisdom have decreed that
the ROW keyword is optional. (As long as there's more than one
column expression; the need for that special case is another reason
why omitting ROW isn't really a nice thing to do.)
regards, tom lane
view thread (18+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected]
Subject: Re: description of Aggregate Expressions
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox