Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个要导出到CSV文件的数据库。
CSV
在其中一个字段 ringPics 中,我的值为
"abc.png,zxc.png"
现在,当我导出到 CSV 时,它会混淆列。
由于数据库很大,我无法,手动替换。
,
我想做这样的事情,替换/\
/\
以下查询需要进行哪些更改
UPDATE `rings` SET `ringPicDir`= REPLACE("ringPicDir", ',', '/\')
尝试这个
UPDATE `rings` SET `ringPicDir`= REPLACE( ringPicDir, ',', '/\') ^^^---no quotes here , you can use backticks also
或这个
UPDATE `rings` SET `ringPicDir` = if (ringPicDir Like '%,%' , REPLACE( ringPicDir, ',', '/\'), ringPicDir)