REPLACE
用第三個表達式替換第一個字符串表達式中出現(xiàn)的所有第二個給定字符串表達式。
語法
REPLACE ( ''string_replace1'' , ''string_replace2'' , ''string_replace3'' )
參數(shù)
''string_replace1''
待搜索的字符串表達式。string_replace1 可以是字符數(shù)據(jù)或二進制數(shù)據(jù)。
''string_replace2''
待查找的字符串表達式。string_replace2 可以是字符數(shù)據(jù)或二進制數(shù)據(jù)。
''string_replace3''
替換用的字符串表達式。string_replace3 可以是字符數(shù)據(jù)或二進制數(shù)據(jù)。
返回類型
如果 string_replace(1、2 或 3)是支持的字符數(shù)據(jù)類型之一,則返回字符數(shù)據(jù)。如果 string_replace(1、2 或 3)是支持的 binary 數(shù)據(jù)類型之一,則返回二進制數(shù)據(jù)。
示例
下例用 xxx 替換 abcdefghi 中的字符串 cde。
SELECT REPLACE(''abcdefghicde'',''cde'',''xxx'')GO
下面是結(jié)果集:
------------abxxxfghixxx(1 row(s) affected)
Copyright ? 2019- 91gzw.com 版權(quán)所有 湘ICP備2023023988號-2
違法及侵權(quán)請聯(lián)系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com
本站由北京市萬商天勤律師事務(wù)所王興未律師提供法律服務(wù)