I need to write a query that finds a single value in multiple columns and then update
those columns where that value exist.
The values that needs to be replaced are in columns that end with _m1
Example table:
o_id a_m1 a_m2 b_m1 b_m2 1 bb cc bb cc 2 cc null bb cc
I need to find all of the “cc” values in columns that end with _m1 and then update those columns to ‘bb”
OR
Note:
These do two different things — I’m not sure what you want.
They both only modify a_m1 and b_m1.
In the first every place in the string where
ccoccurs is replaced withbbIn the second if the value equals exactly
ccit is changed tobbotherwise no change.