내가푼것
select name, tel, replace(tel, substr(tel, 1, INSTR(tel,')')-1), '##')
from student
where length(substr(tel,1,INSTR(tel,')')-1)) = 2
UNION all
select name, tel, replace(tel, substr(tel, 1, INSTR(tel,')')-1), '###')
from student
where length(substr(tel,1,INSTR(tel,')')-1)) = 3;
선생님 답
select name, tel,
lpad(substr(tel, instr(tel,')',1)), 12, '##########')
from student;
'DB > Oracle' 카테고리의 다른 글
[펌][Oracle DB ◈] 고난도 문제 연습 (0) | 2015.05.07 |
---|---|
oracle 퀴즈(생능출판 - 오라클 sql과 pl/sql 책의 기본 sql을 활용) (0) | 2015.05.07 |
oracle-1 함수의종류 - SQL 단일 행 함수 (0) | 2015.04.29 |
oracle 단축키 (0) | 2015.04.29 |
test_data.sql (0) | 2015.04.27 |