422
技術社區[雲棲]
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繪圖(三)繪製文字
走自主化路線 亞信圖建雲安全生態圈