mysql - Find and replace text between ## -


i have lot of records in table p_suppliers

www.loohuis.nl#http://www.loohuis.nl# 

which want have

www.loohuis.nl 

why query not working?

update p_suppliers set site = replace(site, '#%#','') ; 

try way

declare @opentag varchar(10) set @opentag = '#'  update p_suppliers set site= stuff(site,                        charindex(@opentag, site,1)  + len(@opentag),                             charindex('#',site,1)-(charindex(@opentag, site,1)  + len(@opentag)),                         '') 

Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -