본문 바로가기
DataBase/Oracle

JOIN/NON-EQUI-JOIN) NON-EQUI-JOIN

by 박채니 2022. 4. 19.

안녕하세요, 코린이의 코딩 학습기 채니 입니다.

 

개인 포스팅용으로 내용에 오류 및 잘못된 정보가 있을 수 있습니다.


NON-EQUI-JOIN

- 조인 조건절에서 동등비교연산이 아닌 연산자를 사용해 조인하는 경우

 

select
    e.emp_name,
    e.salary,
    s.*
from
    employee e join sal_grade s
        on e.salary between s.min_sal and s.max_sal
order by
    3;

 

[오라클 전용문법 버전]

select
    e.emp_name,
    e.salary,
    s.*
from
    employee e, sal_grade s
where
    e.salary between s.min_sal and s.max_sal;

 

 

select
    e.emp_name,
    e.salary,
    s.*
from
    employee e join sal_grade s
--        on e.salary between s.min_sal and s.max_sal
        on e.salary > s.min_sal
order by
    1;