1
2
3
4
5
6
7
8
9
10
--문자 함수 퀴즈 1)
--Student 테이블을 참조해서 아래 화면과 같이 1 전공이(deptno1 컬럼) 
--101번인 학생의 이름과 전화번호와 지역번호를 출력하세요. 
--단 지역번호는 숫자만 나와야 합니다.
select * from student;
select name, tel, substr(tel, 1, instr(tel, ')' ) -1 ) as "지역번호"
    from student 
    where deptno1 = 101;
--substr(tel, 시작위치, 뽑을갯수);
--substr(tel, 시작위치);
cs

결과

+ Recent posts