我如何做一个简单的“查找和替换"?在 MSSQL 中? [英] How do I do a simple 'Find and Replace" in MsSQL?
本文介绍了我如何做一个简单的“查找和替换"?在 MSSQL 中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
问题是不言自明的.我想做一个简单的查找和替换,就像你在文本编辑器中对我的数据库列中的数据(这是 MS Windows server 2003 上的 MsSQL)
Question is pretty self explanitory. I want to do a simple find and replace, like you would in a text editor on the data in a column of my database (which is MsSQL on MS Windows server 2003)
推荐答案
以下查询将每个 a
字符替换为 b
字符.
The following query replace each and every a
character with a b
character.
UPDATE
YourTable
SET
Column1 = REPLACE(Column1,'a','b')
WHERE
Column1 LIKE '%a%'
这不适用于 SQL Server 2003.
This will not work on SQL server 2003.
这篇关于我如何做一个简单的“查找和替换"?在 MSSQL 中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文