如果我有字符串:
[30.345, -97.345, 4],[30.345, -97.345, 5],[30.345, -97.345, 6],[30.345, -97.345, 7]
如何删除每三个逗号,以便字符串看起来像这样?
[30.345, -97.345, 4][30.345, -97.345, 5][30.345, -97.345, 6][30.345, -97.345, 7] ?
提前致谢。
答案 0 :(得分:5)
如何用],[
][
SELECT REPLACE('[30.345, -97.345, 4],[30.345, -97.345, 5],[30.345, -97.345, 6],[30.345, -97.345, 7].','],[','][');
答案 1 :(得分:2)
sql是一般的,需要更多信息。
这是ORACLE:
从双
中选择替换('你的字符串','],[','] [')答案 2 :(得分:0)
我会使用REPLACE MySQL函数。
以下是有关如何实施该文档的一些文档的链接:http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_replace
类似的东西:
SELECT REPLACE('[30.345, -97.345, 4],[30.345, -97.345, 5],[30.345, -97.345, 6],[30.345, -97.345, 7]', '],[', '][');