Sql Server中REPLACE函数的使用

栏目: 数据库 · SQL Server · 发布时间: 8年前

内容简介:这篇文章主要介绍了Sql Server中REPLACE函数的使用的相关资料,需要的朋友可以参考下

Sql Server中REPLACE函数的使用

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)


以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Computer Age Statistical Inference

Computer Age Statistical Inference

Bradley Efron、Trevor Hastie / Cambridge University Press / 2016-7-21 / USD 74.99

The twenty-first century has seen a breathtaking expansion of statistical methodology, both in scope and in influence. 'Big data', 'data science', and 'machine learning' have become familiar terms in ......一起来看看 《Computer Age Statistical Inference》 这本书的介绍吧!

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具

SHA 加密
SHA 加密

SHA 加密工具