window function and order by

Поиск
Список
Период
Сортировка
От Torsten Förtsch
Тема window function and order by
Дата
Msg-id 52B4ACA2.9020907@gmx.net
обсуждение исходный текст
Ответы Re: window function and order by
Re: window function and order by
Список pgsql-general
Hi,

assuming I have a query that computes a running sum like this:

  select id, buy_price, sum(buy_price) over (order by id) sum
    from fmb
   where 202300<=id and id<=202400
   order by id;

Do I need the ORDER BY clause at the end? Or does the ORDER BY in the
window function already define the order of the result set?

Thanks,
Torsten


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

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: pg_upgrade & tablespaces
Следующее
От: David Johnston
Дата:
Сообщение: Re: window function and order by