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 |
'Database > Basic' 카테고리의 다른 글
concat (0) | 2021.02.09 |
---|---|
문자열함수-upper,lower,initcap,length와lengthb,substr과substrb,instr,lpad,Rpad,Itrim,rtrim (0) | 2021.02.08 |
숫자함수-round(), ceil(), floor(), mod(), trunc() (0) | 2021.02.08 |
집합(그룹) 함수-sum,avg,max,min,count,rank + GROUP BY , HAVING (0) | 2021.02.08 |
between, order by(오름차순과 내림차순) (0) | 2021.02.08 |