猿问

sqlite 批量替换?

sqlite 有批量替换的语法么 
类似mysql的
update `xxx` set `xx`=REPLACE(`abc`, 'aaa', 'bbb');

谢谢!!
目前在sql语气中用 php函数str_replace()来暂时解决了,看看有没有sqlite内置函数有没有REPLACE,语法如何写

白猪掌柜的
浏览 1608回答 1
1回答

慕森卡

sqlite也是有replace函数的,你的意图可以实现:replace(X,Y,Z)The replace(X,Y,Z) function returns a string formed by substituting string Z for every occurrence of string Y in string X. The BINARY collating sequence is used for comparisons. If Y is an empty string then return X unchanged. If Z is not initially a string, it is cast to a UTF-8 string prior to processing.
随时随地看视频慕课网APP

相关分类

iOS
我要回答