I want to update a table with complex entries in a column and just a clause in the column without effecting other values.
Want to update #Rule number=0#
to #Rule number=1#
but without affecting other values in the column. Is this possible?
Are you looking for replace()
? If dynamic_attributes
is a string:
update t
set dynamic_attributes = replace(dynamic_attributes,
'#Rule number=0#',
'#Rule number=1#'
)
where dynamic_attributes like '%#Rule number=0#%';
Note: Strings may not be the best way to store such a list. You should consider a table with one row per customer_id
and dynamic attribute.