-- ์๋ธ์ฟผ๋ฆฌ ์ฌ์ฉ
SELECT A.ANIMAL_ID, A.ANIMAL_TYPE, A.NAME
FROM ANIMAL_INS A
JOIN (
SELECT ANIMAL_ID, ANIMAL_TYPE, NAME
FROM ANIMAL_OUTS
WHERE SEX_UPON_OUTCOME NOT LIKE 'Intact %'
) B
ON A.ANIMAL_ID = B.ANIMAL_ID
WHERE A.SEX_UPON_INTAKE LIKE 'Int%'
ORDER BY A.ANIMAL_ID
-- ์กฐ์ธ๋ง ์ฌ์ฉ.
SELECT A.ANIMAL_ID, A.ANIMAL_TYPE, A.NAME
FROM ANIMAL_INS A
JOIN ANIMAL_OUTS B
ON A.ANIMAL_ID = B.ANIMAL_ID
WHERE A.SEX_UPON_INTAKE LIKE 'Intact%' AND B.SEX_UPON_OUTCOME NOT LIKE 'Intact%'
ORDER BY A.ANIMAL_ID
728x90
':: DBMS ๐ฉ > ํ๋ก๊ทธ๋๋จธ์ค SQL ๊ณ ๋์ kit ํ์ด' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
JOIN>5์ ์ํ๋ค์ ์ด๋งค์ถ ์กฐํํ๊ธฐ (0) | 2023.02.26 |
---|---|
JOIN>์ฃผ๋ฌธ๋์ด ๋ง์ ์์ด์คํฌ๋ฆผ๋ค ์กฐํํ๊ธฐ (0) | 2023.02.26 |
JOIN>๊ทธ๋ฃน๋ณ ์กฐ๊ฑด์ ๋ง๋ ์๋น ๋ชฉ๋ก ์ถ๋ ฅํ๊ธฐ (0) | 2023.02.26 |
JOIN>์ค๋ ๊ธฐ๊ฐ ๋ณดํธํ ๋๋ฌผ(1) (0) | 2023.02.26 |
JOIN>์์๋๋ฐ์ ์์์ต๋๋ค (0) | 2023.02.26 |
๋๊ธ