Re: Selecting All Columns Associated With Maximum Value of One Column

Поиск
Список
Период
Сортировка
От Rich Shepard
Тема Re: Selecting All Columns Associated With Maximum Value of One Column
Дата
Msg-id alpine.LNX.2.00.1110060620330.26051@salmo.appl-ecosys.com
обсуждение исходный текст
Ответ на Re: Selecting All Columns Associated With Maximum Value of One Column  (David Johnston <polobo@yahoo.com>)
Ответы Re: Selecting All Columns Associated With Maximum Value of One Column
Список pgsql-general
On Wed, 5 Oct 2011, David Johnston wrote:

> 2) "Window" -  max(quant) OVER (PARTITION BY ...)

   Hmm-m-m. I have a problem here emulating the example on the document page.
Regardless of which column is first after SELECT postgres tells me that
column does not exist.

select site_id, sample_date, param, max(quant) over (partition by param)
chemistry;
ERROR:  column "site_id" does not exist
LINE 1: select site_id, sample_date, param, max(quant) over (partiti...
                ^
select str_name, site_id, sample_date, param, max(quant) over (partition by
str_name) chemistry;
ERROR:  column "str_name" does not exist
LINE 1: select str_name, site_id, sample_date, param, max(quant) ove...
                ^
   What am I doing incorrectly here?

   Also, with the window function can I limit the output to a single str_name
and param?

Rich

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

Предыдущее
От: Rich Shepard
Дата:
Сообщение: Re: Selecting All Columns Associated With Maximum Value of One Column
Следующее
От: Vincent de Phily
Дата:
Сообщение: Re: Never-idle autovacuum, and does (auto)vacuuming fill the OS cache ?