Re: distinct on extract returns composite type

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: distinct on extract returns composite type
Дата
Msg-id 23495.1569851296@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: distinct on extract returns composite type  (Mariel Cherkassky <mariel.cherkassky@gmail.com>)
Ответы Re: distinct on extract returns composite type  (Mariel Cherkassky <mariel.cherkassky@gmail.com>)
Список pgsql-performance
Mariel Cherkassky <mariel.cherkassky@gmail.com> writes:
> In my query I wrapped the columns with distinct : distinct (extract year...
> , extract quarter..).
> In your query you didnt wrap the columns with distinct but you just
> mentioned it. I guess this is the difference, thanks !

Yeah.  DISTINCT does not have an argument, it's just a keyword you
can stick in after SELECT.  So what you had as the select's targetlist
was (expr,expr), which is read as an implicit row constructor, that
is the same as ROW(expr,expr).  One of many arguably not-well-designed
things about SQL syntax :-(

            regards, tom lane



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

Предыдущее
От: Mariel Cherkassky
Дата:
Сообщение: Re: distinct on extract returns composite type
Следующее
От: Mariel Cherkassky
Дата:
Сообщение: Re: distinct on extract returns composite type