[HACKERS] proposal: window function - change_number

2014-09-21 Thread Pavel Stehule
Hi I tried to solve following task: I have a table start, reason, km = 2014-01-01 08:00:00, private, 10 2014-01-01 09:00:00, commerc, 20 2014-01-01 10:00:00, commerc, 20 2014-01-01 11:00:00, private, 8 and I would reduce these rows to 2014-01-01 08:00:00, private, 10

Re: [HACKERS] proposal: window function - change_number

2014-09-21 Thread David Rowley
On Sun, Sep 21, 2014 at 9:27 PM, Pavel Stehule pavel.steh...@gmail.com wrote: Hi I tried to solve following task: I have a table start, reason, km = 2014-01-01 08:00:00, private, 10 2014-01-01 09:00:00, commerc, 20 2014-01-01 10:00:00, commerc, 20 2014-01-01 11:00:00,

Re: [HACKERS] proposal: window function - change_number

2014-09-21 Thread Mart Kelder
Hi Pavel (and others), Pavel Stehule wrote: Hi I tried to solve following task: I have a table start, reason, km = 2014-01-01 08:00:00, private, 10 2014-01-01 09:00:00, commerc, 20 2014-01-01 10:00:00, commerc, 20 2014-01-01 11:00:00, private, 8 and I would reduce

Re: [HACKERS] proposal: window function - change_number

2014-09-21 Thread Pavel Stehule
2014-09-21 14:30 GMT+02:00 Mart Kelder m...@kelder31.nl: Hi Pavel (and others), Pavel Stehule wrote: Hi I tried to solve following task: I have a table start, reason, km = 2014-01-01 08:00:00, private, 10 2014-01-01 09:00:00, commerc, 20 2014-01-01 10:00:00,

Re: [HACKERS] proposal: window function - change_number

2014-09-21 Thread Mart Kelder
Hi Pavel (and others), Op zondag 21 september 2014 15:35:46 schreef u: 2014-09-21 14:30 GMT+02:00 Mart Kelder m...@kelder31.nl: Hi Pavel (and others), Pavel Stehule wrote: Hi I tried to solve following task: I have a table start, reason, km =

Re: [HACKERS] proposal: window function - change_number

2014-09-21 Thread Pavel Stehule
2014-09-21 17:00 GMT+02:00 Mart Kelder m...@kelder31.nl: Hi Pavel (and others), Op zondag 21 september 2014 15:35:46 schreef u: 2014-09-21 14:30 GMT+02:00 Mart Kelder m...@kelder31.nl: Hi Pavel (and others), Pavel Stehule wrote: Hi I tried to solve following task: I

Re: [HACKERS] proposal: window function - change_number

2014-09-21 Thread Andrew Gierth
Pavel == Pavel Stehule pavel.steh...@gmail.com writes: Pavel Hi Pavel I tried to solve following task: Pavel I have a table Pavel start, reason, km Pavel = Pavel 2014-01-01 08:00:00, private, 10 Pavel 2014-01-01 09:00:00, commerc, 20 Pavel 2014-01-01 10:00:00, commerc,

Re: [HACKERS] proposal: window function - change_number

2014-09-21 Thread Rémi Cura
Hey, sorry I what I say is obvious for you . If I understood your problem correctly, it is strictly equivalent to this one : http://postgresql.1045698.n5.nabble.com/Count-of-records-in-a-row-td5775363.html there is a postgres trick to solve this problem : what you want is essentially generate a

Re: [HACKERS] proposal: window function - change_number

2014-09-21 Thread Pavel Stehule
2014-09-21 17:51 GMT+02:00 Andrew Gierth and...@tao11.riddles.org.uk: Pavel == Pavel Stehule pavel.steh...@gmail.com writes: Pavel Hi Pavel I tried to solve following task: Pavel I have a table Pavel start, reason, km Pavel = Pavel 2014-01-01 08:00:00, private, 10

Re: [HACKERS] proposal: window function - change_number

2014-09-21 Thread Pavel Stehule
2014-09-21 18:08 GMT+02:00 Rémi Cura remi.c...@gmail.com: Hey, sorry I what I say is obvious for you . If I understood your problem correctly, it is strictly equivalent to this one : http://postgresql.1045698.n5.nabble.com/Count-of-records-in-a-row-td5775363.html there is a postgres trick