markella.skempri wrote
> 1 2011-08-20 2011-08-21 1
> 1 2011-08-21 2011-08-27 6
> 1 2011-08-27 2011-08-28 1
> 1 2011-08-28 2011-08-29 1
> 1 2011-08-29 2011-08-30 1
>
> 1 2011-08-20 2011-08-21 1
> 1 2011-08-27 2011-08-28 1 7
> 1 2011-08-21 2011-08-27 6 1
> 1 2011-08-28 2011-08-29 1 1
> 1 2011-08-29 2011-08-30 1 2
Yes, partitioning occurs before ordering. The syntax itself suggests that.
Can you explain why you expect the 27-28 row to belong to the "first" group
and not the "third"?
If that is a typo then you are looking for contiguous blocks with the same
gap-size. Once you've identified those blocks you can then partition on
them and performing your row_number.
David J.
--
View this message in context:
http://postgresql.1045698.n5.nabble.com/BUG-9010-partition-by-overrides-order-by-in-window-functions-tp5789343p5789377.html
Sent from the PostgreSQL - bugs mailing list archive at Nabble.com.