Re: description of Aggregate Expressions

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: description of Aggregate Expressions
Дата
Msg-id 25458.1575588574@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: description of Aggregate Expressions  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-docs
"David G. Johnston" <david.g.johnston@gmail.com> writes:
> On Thu, Dec 5, 2019 at 3:18 PM John Lumby <johnlumby@hotmail.com> 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



В списке pgsql-docs по дате отправления:

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: description of Aggregate Expressions
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: monitoring-stats.html is too impenetrable