12세 이하인 여자 환자 목록 출력하기
https://school.programmers.co.kr/learn/courses/30/lessons/132201
- 문제 풀이
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
SELECT
PT_NAME,
PT_NO,
GEND_CD,
AGE,
CASE
WHEN TLNO IS NULL THEN 'NONE'
ELSE TLNO
END AS "TLNO"
FROM
PATIENT
WHERE
AGE <= 12 AND GEND_CD = 'W'
ORDER BY
AGE DESC,
PT_NAME ASC;
1
2
3
4
SELECT PT_NAME, PT_NO, GEND_CD, AGE, NVL(TLNO, 'NONE') AS "TLNO"
FROM PATIENT
WHERE AGE <= 12 AND GEND_CD = 'W'
ORDER BY AGE DESC, PT_NAME ASC;
- 실행 결과
이 기사는 저작권자의 CC BY 4.0 라이센스를 따릅니다.