repeat Column value in Oracle
I have the following table:
SNO DEPT Name
1 17 RAHUL
2 0 SACHIN
3 0 SAMEER
4 21 GUHAN
5 0 MADAN
6 0 MAHESH
7 19 NISHA
8 0 PREETI
9 0 MUHAMMAD
10 25 SANJAY
11 0 RAKESH
12 0 ANIR
13 0 VIVEK
14 0 AVNEESH
15 28 SOURABH
16 0 SAMEER
I want to update Dept column in a manner so that the first value should be repeated until it encounters the second value,then the second value should be repeated until it encounters third value and so on.
For example I want the output as shown below:
SNO DEPT NAME
1 17 RAHUL
2 17 SACHIN
3 17 SAMEER
4 21 GUHAN
5 21 MADAN
6 21 MAHESH
7 19 NISHA
8 19 PREETI
9 19 MUHAMMAD
10 25 SANJAY
11 25 RAKESH
12 25 ANIR
13 25 VIVEK
14 25 AVNEESH
15 28 SOURABH
16 28 SAMEER
Thanks in advance.