Re: [GENERAL] window function and order by

2013-12-20 Thread Tom Lane
=?ISO-8859-1?Q?Torsten_F=F6rtsch?= writes: > 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 th

Re: [GENERAL] window function and order by

2013-12-20 Thread David Johnston
Torsten Förtsch wrote > 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 B

[GENERAL] window function and order by

2013-12-20 Thread Torsten Förtsch
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 th