728x90
์์ด์ง ๊ธฐ๋ก ์ฐพ๊ธฐ
์ ๋ต
SELECT OUTS.ANIMAL_ID, OUTS.NAME
FROM ANIMAL_OUTS OUTS
left join ANIMAL_INS INS on INS.ANIMAL_ID = OUTS.ANIMAL_ID
WHERE INS.ANIMAL_ID is null
ORDER BY OUTS.ANIMAL_ID
๊ด๋ จ ๋ด์ฉ
https://wakestand.tistory.com/29
์์๋๋ฐ์ ์์์ต๋๋ค
์ ๋ต
SELECT INS.ANIMAL_ID, INS.NAME
FROM ANIMAL_INS INS
left join ANIMAL_OUTS OUTS on OUTS.ANIMAL_ID = INS.ANIMAL_ID
WHERE INS.DATETIME > OUTS.DATETIME
ORDER BY INS.DATETIME
๊ด๋ จ ๋ด์ฉ
SKIP
์ค๋ ๊ธฐ๊ฐ ๋ณดํธํ ๋๋ฌผ(1)
์ ๋ต
SELECT INS.NAME, INS.DATETIME
FROM ANIMAL_INS INS
LEFT JOIN ANIMAL_OUTS OUTS ON INS.ANIMAL_ID = OUTS.ANIMAL_ID
WHERE OUTS.DATETIME is NULL
ORDER BY INS.DATETIME
LIMIT 3
๊ด๋ จ ๋ด์ฉ
SKIP
๋ณดํธ์์์ ์ค์ฑํํ ๋๋ฌผ
์ ๋ต
SELECT OUTS.ANIMAL_ID, OUTS.ANIMAL_TYPE, OUTS.NAME
FROM ANIMAL_OUTS OUTS
left join ANIMAL_INS INS on INS.ANIMAL_ID = OUTS.ANIMAL_ID
WHERE INS.SEX_UPON_INTAKE LIKE 'Intact%'
AND (OUTS.SEX_UPON_OUTCOME Like 'Spayed%'
OR OUTS.SEX_UPON_OUTCOME LIKE 'Neutered%')
ORDER BY OUTS.ANIMAL_ID
๊ด๋ จ ๋ด์ฉ
SKIP
728x90