sql 替换字符串 replace用法
2016-02-12 12:02
337 查看
sql 替换字符串
MSSQL替换语句:update 表名 set 字段名=replace(cast(字段名 as varchar(8000)),'abc.com','buychinaproduct.com')
例如:update PE_Article set Content=replace(cast(Content as varchar(8000)),'http://news.163.com/','http://www.buychinaproduct.com/')
其中PE_Article 为表名 Content为字段名 http://news.163.com/为要替换的内容 http://www.buychinaproduct.com/为替换后的内容。
操作方法很简单,用查询分析器。
MSSQL替换语句:update 表名 set 字段名=replace(cast(字段名 as varchar(8000)),'abc.com','buychinaproduct.com')
例如:update PE_Article set Content=replace(cast(Content as varchar(8000)),'http://news.163.com/','http://www.buychinaproduct.com/')
其中PE_Article 为表名 Content为字段名 http://news.163.com/为要替换的内容 http://www.buychinaproduct.com/为替换后的内容。
操作方法很简单,用查询分析器。
相关文章推荐
- Mac下MySQL的卸载
- Mac下MySQL与MySQLWorkbench的安装
- mysql数据备份--课程笔记
- ubuntu下安装php memcached扩展
- SQL Server 的事务和锁(二)-Range S-S锁
- SQL Server 的事务和锁(一)
- SQL primary key, foreign key
- 升级Oracle 10..2.0.1到Oracle 10.2.0.5
- join operations in SQL
- jfinal学习笔记二(连接数据库)
- 数据库联表查询
- window下安装php memcached扩展
- Redis首页
- Redis文档
- Redis社区
- Redis下载
- Redis支持
- ORM选型
- Java操作MongoDB
- Oracle第学习四天