开发者

How to replace column text in SQL Table?

开发者 https://www.devze.com 2023-02-11 05:26 出处:网络
I have column called CommPostCommUrl in table CommunitiesPostings has text value. CommPostCommUrl --------------------

I have column called CommPostCommUrl in table CommunitiesPostings has text value.

CommPostCommUrl
--------------------
http://communities.site.com/TIGS
http://communities.site.com/TIGS
http://communities.site.com/Leaders
http://communities.site.com/Specialty
http://communities.site.com/Specialty
http://communities.site.com/PN
http://communities.site.com/TIGS/SIM

Replace column text to

CommPostCommUrl
--------------------
http://communitiesdev.site.com/TIGS
http://co开发者_如何学Pythonmmunitiesdev.site.com/TIGS
http://communitiesdev.site.com/Leaders
http://communitiesdev.site.com/Specialty
http://communitiesdev.site.com/Specialty
http://communitiesdev.site.com/PN
http://communitiesdev.site.com/TIGS/SIM

Please provide me Query


UPDATE Table
SET CommonPostURL = REPLACE(CommonPostURL , 
                            'http://communities.',
                            'http://communitiesdev.')


UPDATE CommunitiesPostings
SET CommPostCommUrl = REPLACE (CommPostCommUrl,'communities','communitiesdev')
0

精彩评论

暂无评论...
验证码 换一张
取 消