Re: BUG #5123: bug in window function "last_value"
| От | Tom Lane |
|---|---|
| Тема | Re: BUG #5123: bug in window function "last_value" |
| Дата | |
| Msg-id | 5398.1255701328@sss.pgh.pa.us обсуждение |
| Ответ на | Re: BUG #5123: bug in window function "last_value" (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>) |
| Ответы |
Re: BUG #5123: bug in window function "last_value"
|
| Список | pgsql-bugs |
Heikki Linnakangas <heikki.linnakangas@enterprisedb.com> writes:
> Andrey wrote:
>> select id, first_value(id) over(order by id), last_value(id) over(order by
>> id) from t;
>>
>> RESULT:
>> id | first_value | last_value
>> ----+-------------+------------
>> 1 | 1 | 1
>> 2 | 1 | 2
>> 3 | 1 | 3
>> (3 rows)
>>
>> fist_value - good, last_value - bad
> Looks ok to me. What did you expect?
These *are* the correct answers, since the default window frame runs
from first row to current row. If you don't like them, you may need
to specify a different window frame.
regards, tom lane
В списке pgsql-bugs по дате отправления: