0

I've table like the following

TData   Ucode   Fla
Data1   123 w
Data2   123 NULL
Data3   123 NULL
Data4   123 n
Data5   123 NULL

The excepted result

TData   Ucode   Fla
Data1   123 w
Data2   123 W
Data3   123 W
Data4   123 n
Data5   123 n

I need to update "Fla" where "Ucode" till the "Fla" changes

Raging Bull
  • 18,593
  • 13
  • 50
  • 55
  • 6
    Possible duplicate of [How to get Previous Value for Null Values](https://stackoverflow.com/questions/16669620/how-to-get-previous-value-for-null-values) – Jeroen Mostert Jul 07 '17 at 17:54

1 Answers1

-1

you need to use an update statement

UPDATE table_name SET w='w'. WHERE w is NULL;

it may be worth looking at CASE statements as well (https://www.techonthenet.com/sql_server/functions/case.php)