更新表集col = replace(col,'value1',''),其中col如'%value1%'或设置col = replace(col,'value2',''),其中col如'%value2%'或设置col = replace(col,'value3',''),col如'%value3%';
您可以使用case
表达式:
update table set col = case
when col like '%value1%' then replace(col, 'value1', '')
when col like '%value2%' then replace(col, 'value2', '')
when col like '%value3%' then replace(col, 'value3', '')
end
您也可以将此查询的措辞表达为:
update table set col =
replace(
replace(
replace(col, 'value1', ''),
'value2', ''
),
'value3', ''
)