简体   繁体   English

SQL Server更新行,如“%#186;%”

[英]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 从所有包含&#186的行中删除,这样我的行将看起来像这样

 Street Number 1095 - 4 Esq

The Ideia is only to remove &#186 from all my rows. Ideia只是从我所有行中删除&#186 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 使用REPLACE功能

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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