CASE Expression To Repace Null Values in Cascading Fields
09:06 24 Jun 2016

I am trying to build a CASE expression to handle the table below.

If Service1 is NULL I would like the value in Service2 to replace it. If Service1 and Service2 are NULL I would like the value in Service3 to replace it, etc ... etc ...

I would like to repeat this action on each field so they table is as compressed as possible.

I managed to build a CASE expression but I had duplicate values, as the value moved from Service2 to Service1 but also remained in Service2. I need all of the values to shift based on NULL values so the same values remain on the row but they are as compressed as possible across the columns.

enter image description here

sql sql-server case