๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

๐Ÿ“šAlgorithm ------------/ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค

ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค - level3/์žˆ์—ˆ๋Š”๋ฐ์š” ์—†์—ˆ์Šต๋‹ˆ๋‹ค/MySql


ํ•ด๊ฒฐ๋ฐฉ๋ฒ•

  • ์‚ฌ์‹ค ์–ด๋ ต์ง€ ์•Š๊ฒŒ ํ’€์—ˆ๋Š”๋ฐ ์ œ๋ชฉ์ด ํฌ์ŠคํŒ… ์•ˆํ•  ์ˆ˜๊ฐ€ ์—†๋Š” ์ด๋ฆ„์ด๋ผ..
  • ์ž…์–‘์ผ๊ณผ ๋ณดํ˜ธ์ผ์„ JOIN์„ ์‚ฌ์šฉํ•ด์„œ ๊ฐ™์ด ๋น„๊ตํ•ด์ฃผ๋ฉด ๋—

 

์ฝ”๋“œ

SELECT AI.animal_id, AI.name
FROM
ANIMAL_INS AI INNER JOIN ANIMAL_OUTS AO
ON AI.animal_id = AO.animal_id
WHERE AI.datetime > AO.datetime
ORDER BY AI.datetime