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 Tom Lane <tgl@sss.pgh.pa.us>
"David G. Johnston"  writes:
> On Thu, Dec 5, 2019 at 3:18 PM John Lumby  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
Дата:
От: Michael Paquier
Дата:
FAQ