2016-01-19 23 views

回答

4

您是否在尋找replace()?如果dynamic_attributes是一個字符串:

update t 
    set dynamic_attributes = replace(dynamic_attributes, 
            '#Rule number=0#', 
            '#Rule number=1#' 
            ) 
    where dynamic_attributes like '%#Rule number=0#%'; 

注:字符串可能不存儲這樣的列表的最佳方式。你應該考慮一個表格,每行customer_id和動態屬性。

1

這就是:

UPDATE A 
SET A.dynamic_attributes = REPLACE(A.dynamic_attributes,'#Rule number=0#','#Rule number=1#') 
FROM yourtable AS A 
WHERE A.dynamic_attributes LIKE '%#Rule number=0#%'