https://school.programmers.co.kr/learn/courses/30/lessons/132204

 

프로그래머스

SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프

programmers.co.kr

 

 

생각 흐름

  • 삼중 조인으로 먼저 모든 테이블을 모아넣자.
  • 조건을 where 절에 쓰기만 하면 되겠다.

 

select APNT_NO, PT_NAME, a.PT_NO, a.MCDP_CD, DR_NAME, APNT_YMD
from APPOINTMENT a inner join PATIENT p 
on a.PT_NO = p.PT_NO inner join DOCTOR d
on a.MDDR_ID = d.DR_ID
where a.MCDP_CD like "CS" and APNT_CNCL_YN like "N" and APNT_YMD like "2022-04-13%"
order by APNT_YMD

+ Recent posts