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);
结果:
SQL Server 2000 函数使用---CAST 和 CONVERT 日期格式样式,借以将 datetime 或 smalldatetime 数据转换为字符数据(nchar、nvarchar、char、varchar、nchar 或 nvarchar 数据类型);或者字符串格式样式,借以将 float、real、money 或 smallmoney 数据转换为字符数据(nchar、nvarchar、char、varchar、nchar 或 nvarchar 数据类型)。
SQL Server函数之空值处理 原文:SQL Server函数之空值处理 coalesce( expression [ ,...n ] )返回其参数中第一个非空表达式。 Select coalesce(null,null, 1 , 2 ) //结果为 1 coalesce(expression1,.
深入理解SQL Server 2005 中的 COLUMNS_UPDATED函数 原文:深入理解SQL Server 2005 中的 COLUMNS_UPDATED函数 COLUMNS_UPDATED函数能够出现在INSERT或UPDATE触发器中AS关键字后的任何位置,用来指示表或视图中有哪些列已被插入或者更新。
相关文章
- Sql server DATEADD日期函数的使用[通俗易懂]
- SQL Server中QUOTENAME函数的使用
- SQL Server中的RAND函数的介绍和区间随机数值函数的实现
- SQL Server 常用函数使用方法小结
- SQL SERVER 2012新增函数之字符串函数FORMAT详解
- SQL Server分析函数深度剖析(sqlserver分析函数)
- 提高查询效率!实现数据分离!深度解析SQL Server分区索引(sqlserver分区索引)
- Exploring the Power of SQL Server in Big Data Analytics(sqlserver大数据)
- SQL Server备份:守护数据安全(备份的sqlserver)
- MySQL与SQL Server: 主从配置的用处(主从sqlserver)
- SQL Server警惕误还原的危险性(sqlserver误还原)
- SQL Server与技术革新:从转变到飞跃(sqlserver 强转)
- 日SQL Server数据库中的年月日现象研究(sqlserver 年月)
- 让SQL Server支持更多的字体!(sqlserver字体)
- SQL Server多替换技巧:提高数据处理能力(sqlserver多替换)
- SQL Server后的注册之路——让更多使用者记住它(sqlserver后注册)
- 探索SQL Server函数栈实现复杂功能(sqlserver函数栈)
- SQL Server内部锁:控制系统安全的关键(sqlserver内部锁)
- 康监测使用SQL Server优化健康监测的有效方法(sqlserver健)
- SQL Server中优秀的OB方案应用(ob sqlserver)
- serverMySQL 与 SQL Server 的比较与选择(mysql 和 sql)
- sql使用cxoracle写出优化的SQL(cx_oracle写死)
- 从Oracle中探索SQL函数的应用(oracle中sql函数)