我有以下几行:
Name Url
name1 http://foo.com/this/that
name6 http://that.net/hello
name2 http://foo.com/hello/world
name3 http://foo.com/world/hello
name4 http://hello.com/this/that
我需要编写一个查询,将每个
foo.com
更改为hello.com
。有任何想法吗?
最佳答案
看一下REPLACE()函数:http://msdn.microsoft.com/en-us/library/ms186862.aspx。您应该能够在UPDATE语句中使用它来获得所需的结果。
关于sql - 如何找到子字符串并替换它?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5353416/