๋ฌธ์
์ทจ์๋์ง ์์ ์ง๋ฃ ์์ฝ ์กฐํํ๊ธฐ
ํ์ด
SELECT A.APNT_NO, P.PT_NAME, P.PT_NO, A.MCDP_CD, D.DR_NAME, A.APNT_YMD
FROM APPOINTMENT A JOIN PATIENT P
ON A.PT_NO = P.PT_NO
JOIN DOCTOR D
ON A.MCDP_CD = D.MCDP_CD AND A.MDDR_ID = D.DR_ID
WHERE TO_CHAR(A.APNT_YMD, 'YYYYMMDD') = '20220413' AND
A.MCDP_CD = 'CS' AND
A.APNT_CNCL_YN = 'N'
ORDER BY A.APNT_YMD
;