정규식

-Java 2014. 10. 14. 20:06

 

----------------------
정규식
----------------------
1)job_id가 a~f까지 시작하는 사원의 이름, job_id를 조회
select sysdate "시간", first_name "성명", job_id

from employees

where regexp_like(lower(job_id),'^[a-f]') -->job_id like "A%' or job_id like 'B%'
2) 이메일주소가 L~S로 시작하는 사원의 이름, 이메일주소 조회
select first_name "사원명", email "E-메일"

from employees

where regexp_like(lower(email),'^[l-s]')
3) 성명이 a~l로 끝나는 사원의 이름과 연락처를 조회
select first_name "성명", phone_number "연락처"

from employees

where regexp_like(lower(first_name),'[a-l]$')

'-Java' 카테고리의 다른 글

형 변환 함수  (0) 2014.10.14
날짜 함수  (0) 2014.10.14
단일행 함수  (0) 2014.10.14
집합 연산자  (0) 2014.10.14
오라클 데이터형, 테이블 생성  (0) 2014.10.13
Posted by G-bong
,