- Goal
文字列から特定の文字だけを抜き出す
(例) 123 My 4566,,, name .. is 0#$%0 John. からアルファベットだけを抜き出す
結果として、MYNAMEISJOHNだけを抜き出す - Source
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersselect replace(translate(<input sentence>, replace(translate(<input sentence>,<search letter>, <dummy letter>),''),'x'),'x','') from dual; --- EX) select alphabet only select replace(translate(upper('123 My 4566,,, name .. is 0#$%0 John.'), replace(translate(upper('123 My 4566,,, name .. is 0#$%0 John.'), 'ABCDEFGHIJKLMNOPQRSTUVWXYZ','0'),''),'x'),'x','') from dual; ---- ----Result ---- MYNAMEISJOHN
自動でUSERIDを作って付与するときに使用
頭6文字の英字+連番をUSERIDとして使うなど
Oracle Application Express Notes | Apps development Notes | Google Cloud Platform | Python | apps test | Cool Beans | English | Books
2016/03/11
文字列から特定の文字だけを抜き出す - SQL
登録:
コメントの投稿 (Atom)
0 件のコメント:
コメントを投稿