I am struggling with the following (apparently) easy task; my table (call it table1) look like this:
id | date | value ------------------ 1 | 01 | 100 1 | 02 | 103 1 | 04 | 105 1 | 05 | 90 1 | 06 | 95 1 | 09 | 0 2 | 02 | 110 2 | 03 | 98 2 | 04 | 97 2 | 07 | 71 2 | 08 | 84 2 | 10 | 0 ------------------ I would like to replace the two 0s with, respectively 95 and 84 (i.e. previous values in time). Any solution? I have been spending a looot of time on this (sorry but I am quite new to SQL)