字段内容比较有规律,所以选择substring_index函数并配合concat字符串链接函数进行有效的配合和实现最终效果。
细节:
主要是将a中的记录进行匹配分割,然后update到b字段,其次再进行拼并更新到url字段中。
整条语句不是很复杂,但是却很好的解决了问题,并将SQL函数运用自如。
字符串内容:
/test/abc /test http://test.fsdafdfd.com
以下是SQL语句:
希望解占辉的方法能够帮助到你,如果需要与我交流,可以EMAIL给我或其他方式,联系方式再BLOG首页,谢谢!