Search Postgresql Archives

window function and order by

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux