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开发知识:Sql server中内部函数fn_PhysLocFormatter存在解析错误
- 在SQL Server中查询资料库的TABLE数量与名称的sql语句
- 阿里云上使用SQL Server云数据库管理系统(阿里云sqlserver)
- 字符使用SQL Server中的转义字符(sqlserver转义)
- MSSQL导出SQL文件的简易方法(mssql导出sql文件)
- 和 sql server支持两者:Oracle 和 SQL Server的兼容性(兼容oracle)
- Oracle SQL查询前一天的数据(oracle前一天sql)
- SQL Server中使用空函数处理数据操作(空函数sqlserver)
- 暂停SQL Server:快速解决系统故障!(暂停sqlserver)
- SQL Server数据库:它们真实面貌(sqlserver长啥样)
- SQL Server跳板机:安全、高效的远程管理神器(sqlserver跳板机)
- 密码SQL Server登录失败:无效的密码(sqlserver无效的)
- SQL Server数据库空库导入实践(sqlserver导空库)
- SQL Server实现取差集的方法(sqlserver取差集)
- 利用SQL Server实现列的分组(sqlserver列分组)
- Oracle数据库如何导出SQL文件?(oracle 导sql)
- 函数SQL Server中计算位数的函数使用技巧(sqlserver中位数)
- SQL Server之虚列:掌握平衡与精准(sqlserver虚列)
- 掌握 Oracle 中的 SQL 技能(oracle 中的sql)
- Oracle数据库深入学习SQL标签的用法(oracle中sql标签)
- 审查明晰Oracle SQL的利弊(oracle sql审查)