Sql Server中REPLACE函数的使用
作者:mrr 时间:2024-01-25 10:48:51
REPLACE
用第三个表达式替换第一个字符串表达式中出现的所有第二个给定字符串表达式。
语法
REPLACE ( ''string_replace1'' , ''string_replace2'' , ''string_replace3'' )
参数
''string_replace1''
待搜索的字符串表达式。string_replace1 可以是字符数据或二进制数据。
''string_replace2''
待查找的字符串表达式。string_replace2 可以是字符数据或二进制数据。
''string_replace3''
替换用的字符串表达式。string_replace3 可以是字符数据或二进制数据。
返回类型
如果 string_replace(1、2 或 3)是支持的字符数据类型之一,则返回字符数据。如果 string_replace(1、2 或 3)是支持的 binary 数据类型之一,则返回二进制数据。
示例
下例用 xxx 替换 abcdefghi 中的字符串 cde。
SELECT REPLACE(''abcdefghicde'',''cde'',''xxx'')GO
下面是结果集:
------------abxxxfghixxx(1 row(s) affected)
标签:sql,server,replace,函数
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
Python中的延迟绑定原理详解
2022-07-08 16:18:35
python奇偶行分开存储实现代码
2022-01-30 09:30:24
![](https://img.aspxhome.com/file/2023/2/90282_0s.png)
asp金额大小写转换完全无错版
2007-09-26 09:38:00
取巧的边框等高
2009-12-16 12:11:00
![](https://img.aspxhome.com/file/UploadPic/200912/16/css_border-13s.png)
Python locust工具使用详解
2021-11-04 04:04:56
![](https://img.aspxhome.com/file/2023/3/83703_0s.png)
Numpy 多维数据数组的实现
2022-12-22 11:26:03
![](https://img.aspxhome.com/file/2023/3/97113_0s.png)
python应用之如何使用Python发送通知到微信
2022-03-04 01:59:55
![](https://img.aspxhome.com/file/2023/6/102986_0s.png)
BootStrap Select清除选中的状态恢复默认状态
2024-04-28 09:42:05
![](https://img.aspxhome.com/file/2023/8/132818_0s.png)
我的“Orcas初览”讲座
2007-09-23 12:53:00
![](https://img.aspxhome.com/file/UploadPic/20079/23/2007923125747404s.gif)
MySQL数据库设置远程访问权限方法小结
2024-01-16 11:12:24
SQL进行排序、分组、统计的10个新技巧分享
2024-01-17 22:44:12
分享十款最出色的PHP安全开发库中文详细介绍
2023-06-15 01:04:59
![](https://img.aspxhome.com/file/2023/1/55491_0s.jpg)
Python 根据数据模板创建shapefile的实现
2023-07-27 00:10:32
python实现定时发送邮件
2022-12-20 07:49:49
SQL Server 2005 输入框不能输入中文问题
2010-02-04 09:14:00
擦除式图片轮番显示效果
2013-08-10 11:01:48
通过实例了解python__slots__使用方法
2023-03-16 13:24:50
selenium.webdriver中add_argument方法常用参数表
2023-12-05 13:39:38
关于自动化测试框架pytest的Fixture固件
2023-10-16 00:02:50
![](https://img.aspxhome.com/file/2023/9/97539_0s.png)
Vue3 组件库的环境配置搭建过程
2024-04-30 10:19:58
![](https://img.aspxhome.com/file/2023/6/130286_0s.png)