✅ 코드
SELECT I.ANIMAL_ID
, I.ANIMAL_TYPE
, I.NAME
FROM ANIMAL_INS AS I
INNER JOIN ANIMAL_OUTS AS O ON I.ANIMAL_ID = O.ANIMAL_ID
WHERE I.SEX_UPON_INTAKE LIKE 'Intact%'
AND O.SEX_UPON_OUTCOME NOT LIKE 'Intact%'
ORDER BY ANIMAL_ID
간단한 조인 문제였습니다.
'알고리즘' 카테고리의 다른 글
[SQL]프로그래머스 Lv.2 가격대별 상품 개수 구하기 (0) | 2023.08.07 |
---|---|
[SQL]프로그래머스 Lv.3 조건에 맞는 사용자와 총 거래금액 조회하기 (0) | 2023.08.07 |
[SQL]프로그래머스 Lv.3 오랜 기간 보호한 동물(2) (0) | 2023.08.07 |
[SQL]프로그래머스 Lv.3 있었는데요 없었습니다 (0) | 2023.08.07 |
[SQL]프로그래머스 Lv.3 오랜 기간 보호한 동물(1) (0) | 2023.08.06 |