• Home
  • About
    • ming photo

      ming

      studying

    • Learn More
    • Twitter
    • Facebook
    • Instagram
    • Github
    • Steam
  • Archive
    • All Posts
    • All Tags
    • All categories
  • categories
    • HTML+CSS+JavaScript
    • JAVA
    • Algorithm
    • DB
    • JSP
    • 정보처리기사
    • Spring
    • Thymeleaf
    • 기술면접
  • Projects

DB -SQL - sql전문가 정미나 - 오라클 중급강의 : 서브쿼리(where절)

04 Mar 2021

🔷실습

✔ WHERE에서 쓰이는 중첩 서브쿼리

- 서브쿼리 : 쿼리안에 존재하는 또다른 쿼리
  • 코드
    
      select * from hr.employees a
      -- a.department_id를 서브쿼리로 준다
      -- b.location_id = 1800 인 
      -- hr.departments b 부서에서
      -- b.department_id 부서아이디를 셀렉트 한다음
      -- a.department_id 부서의 아이디를 가지는 사원을 뽑아내는 쿼리
      where a.department_id = (select b.department_id
                              from hr.departments b
                              where b.location_id = 1800);
            
    


Share Tweet +1