338. 오랜 기간 보호한 동물(2)

김해준's avatar
Feb 12, 2026
338. 오랜 기간 보호한 동물(2)

언어 : MySQL

문제

notion image
notion image

풀이 과정

ANIMAL_INS 테이블 데이터 조회
notion image
ANIMAL_ID를 기준으로 ANIMAL_OUTS테이블 조인하기
notion image
보호기간이 긴 순서로 정렬(outs.datetime - ins.datetime)
notion image
ANIMAL_ID와 NAME만 조회 (2마리만)
notion image
notion image
Share article