Re: [ADMIN] windown function count Unexpected results

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: [ADMIN] windown function count Unexpected results
Дата
Msg-id CAKFQuwZiaZdre==Pbe-wgg_gO_eFWbNNakB+0ZgwBYEsstTAfA@mail.gmail.com
обсуждение исходный текст
Ответ на [ADMIN] windown function count Unexpected results  (winston cheung <winston_cheung@163.com>)
Список pgsql-admin
On Thursday, May 4, 2017, winston cheung <winston_cheung@163.com> wrote:
, why the value of each line are different?

 window w as (partition by department_id order by salary desc);


This isn't an admin question; general or novice would be a better mailing list.

The answer is you added an order by clause to your window definition.  The docs explain why doing that results in each row of the partition only summing the rows before and including the current row.

David J. 

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

Предыдущее
От: winston cheung
Дата:
Сообщение: [ADMIN] windown function count Unexpected results
Следующее
От: Steven Chang
Дата:
Сообщение: Re: [ADMIN] windown function count Unexpected results