0

Input File

Output

I have tried using lead but obviously didn't work bcs of multiple nulls.and "last_value" with "ignore nulls" using partitions did n't workout bcs "ignore nulls" function is not available in PostgreSQL.

Ms13
  • 151
  • 2
  • 2
  • 14
  • 1
    Possible duplicate of [How do I efficiently select the previous non-null value?](http://stackoverflow.com/questions/18987791/how-do-i-efficiently-select-the-previous-non-null-value) – Mureinik Aug 04 '16 at 08:49

1 Answers1

0

i suggest write pgsql function which find all rows where service is null, then update this value to (previous or next) fisrt where value is not null

Piotr Rogowski
  • 3,642
  • 19
  • 24