I have a table like:
colA | colB
" " | 1
"K 111" | 1
"K222" | 2
" " | 3
Some columns have only a space (" "), some have "K {number}", some have "K{number}".
If colA has only a space I want that value replaced with the one from colB.
So endresult should be:
colA | colB
1 | 1
"K 111" | 1
"K222" | 2
3 | 3
How can I do this?
You can use a
case
expression:If you wanted to be more general, you might use
like
:In an
update
, you would move thewhen
condition to a filtering condition: