■ TRANSLATE 함수 : 소스 문자열의 문자 대체하기

------------------------------------------------------------------------------------------------------------------------

SELECT TRANSLATE('abcd'                          , 'ab'  , '12' ) FROM DUAL; -- '12cd'

 

SELECT TRANSLATE('12345'                         , '15'  , 'xx' ) FROM DUAL; -- 'x234x'

 

SELECT TRANSLATE('grumpy old possum'             , 'uot' , '%$*') FROM DUAL; -- 'gr%mpy $ld p$ss%m'

 

SELECT TRANSLATE('my language needs the letter e', 'egms', 'X'  ) FROM DUAL; -- 'y lanuaX nXXd thX lXttXr X'

 

SELECT TRANSLATE('please go away'                , 'a'   , NULL ) FROM DUAL; -- NULL

------------------------------------------------------------------------------------------------------------------------

Posted by 사용자 icodebroker
TAG

댓글을 달아 주세요