J'ai les lignes suivantes:
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
5 Réponses :
UPDATE <table name> SET Url = REPLACE (Url, "foo.com" , "hello.com")
Jetez un oeil à la fonction Remplacer (): http: // msdn. microsoft.com/en-us/library/ms186862.aspx . Vous devriez être capable d'utiliser cela dans une instruction de mise à jour pour obtenir le résultat souhaité. P>
Consultez le Remplacer fonction:
update table set url = replace(url, 'foo.com', 'hello.com')
UPDATE table SET Url = REPLACE(url, 'foo.com', 'hello.com')
UPDATE table SET Url = REPLACE(url, 'http://foo.com/', 'http://hello.com/') it's safer!!