728x90
    
    
  <전화번호>
select REGEXP_REPLACE(REGEXP_REPLACE(tel, '(02|.{3})(.+)(.{4})', '\1-\2-\3'), '(.{3})(.*)(.{4})', '\1-****-\3') as tel1
		--   결과:  010-****-4567
        ,REPLACE(REGEXP_REPLACE(REGEXP_REPLACE(tel, '(02|.{3})(.+)(.{4})', '\1-\2-\3'), '(.{3})(.*)(.{4})', '\1-****-\3'),'-','') as tel2
        --   결과:  010****4567
from dual
<이메일>
select REGEXP_REPLACE('test@test.co.kr'  , '([[:alnum:]]+)(@[[:alnum:]]+(\.[[:alnum:]]+)+)','*******\2')
from dual -- 결과: ****@test.co.kr
728x90
    
    
  'SQL > ORACLE' 카테고리의 다른 글
| [Oracle] 다중 INSERT - 여러 행 한번에 넣기 (0) | 2022.01.15 | 
|---|---|
| [ORACLE] NULL 값 치환 NVL, NVL2 함수 - 그룹핑 예제 포함! (0) | 2022.01.09 | 
| [Oracle] 오라클에서 데이터 타입 number VS integer VS int 차이 (0) | 2021.08.31 | 
댓글