코딩테스트[파이썬]/프로그래머스 sql 고득점 kit

JOIN - 보호소에서 중성화한 동물

softmoca__ 2024. 2. 28. 20:43
목차

https://school.programmers.co.kr/learn/courses/30/lessons/59045

SELECT O.ANIMAL_ID,O.ANIMAL_TYPE,O.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 LIKE 'Spayed%' or  O.SEX_UPON_OUTCOME LIKE 'Neutered%' )
order by I.ANIMAL_ID