函数:replace
含义:替换字符串
语法:replace(原字段,“原字段旧内容“,“原字段新内容“,)
eg:
- SELECT L.USER_NAME,
- REPLACE(L.USER_NAME, SUBSTR(L.USER_NAME, 2, 3), '***') USER_NAME_REPLACE
- FROM SYS_USER_PWD_LOG L
- WHERE L.USER_NAME LIKE '%ZB_WN%'
SELECT L.USER_NAME,
REPLACE(L.USER_NAME, SUBSTR(L.USER_NAME, 2, 3), '***') USER_NAME_REPLACE
FROM SYS_USER_PWD_LOG L
WHERE L.USER_NAME LIKE '%ZB_WN%'
结果为:
1 ZB_WN Z***N
2 ZB_WN Z***N
3 ZB_WN Z***N
4 ZB_WN Z***N
5 ZB_WN Z***N