mysql的replace函式
阿新 • • 發佈:2020-11-13
將單引號與雙引號的替換,有時候在json處理中需要:
dba@xxx ((none)) > select replace('xxxx"12345"677777','\"',"'"); +---------------------------------------+ | replace('xxxx"12345"677777','\"',"'") | +---------------------------------------+ | xxxx'12345'677777 | +---------------------------------------+ 1 row in set (0.07 sec) Thu Nov 12 17:14:03 2020 dba@xxx ((none)) > select replace("xxxx'12345'677777","'",'\"'); +---------------------------------------+ | replace("xxxx'12345'677777","'",'\"') | +---------------------------------------+ | xxxx"12345"677777 | +---------------------------------------+ 1 row in set (0.07 sec) Thu Nov 12 17:15:44 2020
###################################