Sql Server REPLACE函式的使用

2021-09-06 00:14:52 字數 659 閱讀 5213

replace

用第三個表示式替換第乙個字串表示式中出現的所有第二個給定字串表示式。

語法replace ( ''string_replace1'' , ''string_replace2'' , ''string_replace3'' )

引數''string_replace1''

待搜尋的字串表示式。string_replace1 可以是字元資料或二進位制資料。

''string_replace2''

待查詢的字串表示式。string_replace2 可以是字元資料或二進位制資料。

''string_replace3''

替換用的字串表示式。string_replace3 可以是字元資料或二進位制資料。

返回型別

如果 string_replace(1、2 或 3)是支援的字元資料型別之一,則返回字元資料。如果 string_replace(1、2 或 3)是支援的 binary 資料型別之一,則返回二進位制資料。

示例下例用 *** 替換 abcdefghi 中的字串 cde。

select replace(''abcdefghicde'',''cde'',''***'')go

下面是結果集:

------------ab***fghi***(1 row(s) affected)

Sql Server REPLACE函式的使用

replace 更新替換資料庫某個欄位的的部分的值,比如替換資料庫中url欄位的網域名稱,語法 replace cloum string old string old 引數 cloum 待替換欄位的字串表示式。string old 待查詢的字串表示式。string old 替換用的字串表示式。示列 ...

SQL SERVER replace 函式說明

replace string replace1 string replace2 string replace3 引數解析 string replace1 待搜尋的字串表示式。string replace1 可以是字元資料或二 進製資料 string replace2 待查詢的字串表示式。string...

如何使EnableMenuItem函式的呼叫有效

在mfc環境下menu的修改在預設的情況下是通過ccmdui來改變的,呼叫enablemenuitem函式無效 不管是全域性api還是 cmenu類的成員函式 但是只要修改cframewnd類的乙個成員變數m bautomenuenable就可以使呼叫的函式有效.m bautomenuenable在...