Re: BUG #5123: bug in window function "last_value"
От | Hitoshi Harada |
---|---|
Тема | Re: BUG #5123: bug in window function "last_value" |
Дата | |
Msg-id | e08cc0400910160658y68693c6ds92b1c4714d87663c@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: BUG #5123: bug in window function "last_value" (Tom Lane <tgl@sss.pgh.pa.us>) |
Список | pgsql-bugs |
2009/10/16 Tom Lane <tgl@sss.pgh.pa.us>: > 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 | =A0 =A0 =A0 =A0 =A0 1 | =A0 =A0 =A0 =A0 =A01 >>> 2 | =A0 =A0 =A0 =A0 =A0 1 | =A0 =A0 =A0 =A0 =A02 >>> 3 | =A0 =A0 =A0 =A0 =A0 1 | =A0 =A0 =A0 =A0 =A03 >>> (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. =A0If you don't like them, you may need > to specify a different window frame. > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0regards, tom lane > And it's well-documented. See http://www.postgresql.org/docs/8.4/static/functions-window.html --=20 Hitoshi Harada
В списке pgsql-bugs по дате отправления: