开发者

help with sqlite replace function

开发者 https://www.devze.com 2023-03-29 15:35 出处:网络
am trying to update my database table that looks like this name| file_n开发者_JS百科ame ----------------

am trying to update my database table that looks like this

name  | file_n开发者_JS百科ame
----------------
name1 | name1\data

what i want to do is, to replace all the name1 from name found in file_name column with empty string

update cache set
file_name=replace(file_name,name,'')
where file_name like '%'||name||"%'"

When i execute the query above, i get an empty recordset.

can anybody help me fix this


UPDATE cache SET file_name=replace(file_name, name, '');

Worked without the WHERE clause.

0

精彩评论

暂无评论...
验证码 换一张
取 消