Below is the scenario I need solution on this in Netezza SQL.
if you look at below input 2nd record 2nd column is empty but I need value form above 'H' record. expected will be "A,CP,2" for 2nd row. same as for 4th row i would require value from 3rd record 'H' so expected would be "E,SP,4"
Input data
H,CP,1
A,,2
H,SP,3
E,,4
H,,5
C,,6
Output:
H,CP,1
A,CP,2
H,SP,3
E,SP,4
H,,5
C,,6
second input example: INPUT
c1,c2,c3
H,P,1
H,Q,2
E,,3
A,,4
H,R,5
A,,6
C,,7
H,,8
E,,9
H,S,10
OUTPUT
H,P,1
H,Q,2
E,Q,3
A,Q,4
H,R,5
A,R,6
C,R,7
H,,8
E,,9
H,S,10