문제
MYSQL
내가 작성한 정답
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.MDDR_ID = d.DR_ID
where apnt_ymd like '%2022-04-13%'
and a.MCDP_CD = 'CS'
and a.APNT_CNCL_YN = 'N'
order by 6 asc
ORACLE
내가 작성한 정답
SELECT a.APNT_NO, p.PT_NAME, a.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.MDDR_ID = d.DR_ID
where to_char(a.APNT_YMD,'yymmdd') = '220413'
and a.APNT_CNCL_YN = 'N'
and a.MCDP_CD = 'CS'
order by APNT_YMD asc
Share article