[mysql/oracle] 12세 이하인 여자 환자 목록 출력하기

2023. 1. 28. 22:01Programmers/SQL

문제

결과

mysql

1
2
3
4
SELECT pt_name, pt_no, gend_cd, age, IFNULL(tlno, 'NONE') TLNO
from patient
where age <=12 and gend_cd = 'W'
ORDER BY AGE DESC, PT_NAME
cs

oracle

1
2
3
4
SELECT pt_name, pt_no, gend_cd, age, NVL(tlno, 'NONE') TLNO
from patient
where age <=12 and gend_cd = 'W'
ORDER BY AGE DESC, PT_NAME
cs