Re: [SQL] Your question about date

2005-03-22 Thread Béatrice Yueksel
Perhaps it will be better if you put an 'order by' in the select. SELECT (( select test1.date from test test1 where test1.date > test.date order by date limit 1) - test.date ) AS result from test order by date; result 42 31 33 25 Re

Re: [SQL] Your question about date

2005-03-22 Thread Christoph Haller
That's a good one, but it has the disadvantage of giving a null result row: insert into test values ( '2004-12-22' ) ; The SELECT from below gives result 31 33 25 (null) 42 (5 rows) Also, I am not sure about the order of values. Anyway, Béatrice, thanks for your

Re: [SQL] Your question about date

2005-03-21 Thread Béatrice Yueksel
Dear Christoph, perhaps you could try something like this example. Regards, BÃatrice The table: -- # select * from test; date 2005-02-02 2005-03-05 2005-04-07 2005-05-02 (4 rows) The query -- SELECT (( select test1.date from test test1