Re: [SQL] "compressing" consecutive values into one

2010-11-23 Thread bricklen
On Tue, Nov 23, 2010 at 10:13 AM, Louis-David Mitterrand wrote: > On Tue, Nov 23, 2010 at 03:31:59PM -, Oliveiros d'Azevedo Cristina wrote: >> Salut, Louis-David, >> >> Can you please state the columns belonging to price table >> and give a concrete example? >> Say, data before and data after

Re: [SQL] "compressing" consecutive values into one

2010-11-23 Thread Louis-David Mitterrand
On Tue, Nov 23, 2010 at 03:31:59PM -, Oliveiros d'Azevedo Cristina wrote: > Salut, Louis-David, > > Can you please state the columns belonging to price table > and give a concrete example? > Say, data before and data after you want to do? Hi Cristina, Data before: id_price | price

Re: [SQL] "compressing" consecutive values into one

2010-11-23 Thread Oliveiros d'Azevedo Cristina
Salut, Louis-David, Can you please state the columns belonging to price table and give a concrete example? Say, data before and data after you want to do? Thank you A bien-tôt, Oliveiros - Original Message - From: "Louis-David Mitterrand" To: Sent: Tuesday, November 23, 2010 3:19 P

[SQL] "compressing" consecutive values into one

2010-11-23 Thread Louis-David Mitterrand
Hi, On time series price data I'm trying to remove consecutive identical prices and keep only the latest. I tried: delete from price where id_price in (select t.id_price2 from (select first_value(p.id_price) over w as id_price1, nth_value(p.