简体   繁体   中英

Sql Server Update Rows where like '%#186;%'

Hello I have in my database a bunch of table rows that contain the following values:

Street Number 1095 - 4º Esqº

and I am trying to remove

º 

from all the rows that contain &#186 so that my rows would look like so

 Street Number 1095 - 4 Esq

The Ideia is only to remove &#186 from all my rows. I started to create a query like so

UPDATE [dbo].[PersonTable]
   SET [street] =  // The problem I am having is what to put here

 WHERE street like '%º%'

Could any one please help me with this issue. Thank´s

使用replace

set [street] = replace([street], 'º', '')

Use the REPLACE function

 UPDATE [dbo].[PersonTable]
 SET [street] =  REPLACE([street], '%º%', '')
 WHERE street like '%º%'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM