Sql Server REPLACE函数
Replaces all occurrences of a specified string value with another string value.
语法:
REPLACE ( string_expression , string_pattern , string_replacement )
参数:
string_expression
Is the string expression to be searched. string_expression can be of a character or binary data type.
string_pattern
Is the substring to be found. string_pattern can be of a character or binary data type. string_pattern cannot be an empty string (''), and must not exceed the maximum number of bytes that fits on a page.
string_replacement
Is the replacement string. string_replacement can be of a character or binary data type.
返回
Returns nvarchar if one of the input arguments is of the nvarchar data type; otherwise, REPLACE returns varchar.
Returns NULL if any one of the arguments is NULL.
If string_expression is not of type varchar(max) or nvarchar(max), REPLACE truncates the return value at 8,000 bytes. To return values greater than 8,000 bytes, string_expression must be explicitly cast to a large-value data type.
即用第三个表达式替换第一个字符串表达式中出现的所有第二个给定字符串表达式。
例子:
SELECT REPLACE('AAAAAXXXAAA','X','A');
结果:
最后更新:2017-04-03 12:56:41
上一篇:
写程序很难之logstash之file input插件实现分析
下一篇:
SLB产品商业化模式介绍及价格总览
阿里云全球第二批MVP 祁宁专访 - 社区的成长才是我们的价值所在
Linux Debugging(三): C++函数调用的参数传递方法总结(通过gdb+反汇编)
Flink - FlinkKafkaConsumer08
几个关于oceanbase因系统原因 sql执行失败的案例
phpMyAdmin的安装
企业级容器云平台EcOS-Newben更新至3.0版,全面支持主控节点的高可用
珠联璧合:GitLab 10.0版本与Kubernetes的巧妙集成
Tomcat 7之无需JDK只需JRE与无需web.xm及J2SE 6.0之真实与谎言?
[Qt教程] 第13篇 2D绘图(三)绘制文字
走自主化路线 亚信图建云安全生态圈