"David G. Johnston" <david.g.johns...@gmail.com> writes: > On Thu, Dec 5, 2019 at 3:18 PM John Lumby <johnlu...@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