-- 코드를 입력하세요
-- SELECT I.ANIMAL_ID, I.NAME
-- FROM ANIMAL_INS I JOIN ANIMAL_OUTS O ON I.ANIMAL_ID = O.ANIMAL_ID
-- WHERE ROWNUM <= 2
-- ORDER BY O.DATETIME - I.DATETIME DESC;
SELECT *
FROM
(
SELECT I.ANIMAL_ID, I.NAME
FROM ANIMAL_INS I JOIN ANIMAL_OUTS O ON I.ANIMAL_ID = O.ANIMAL_ID
ORDER BY O.DATETIME - I.DATETIME DESC
)
WHERE ROWNUM <= 2;
FROM - WHERE - GROUP BY - HAVING - SELECT - ORDER BY
FROM - WHERE - GROUP BY - HAVING - SELECT - ORDER BY
FROM - WHERE - GROUP BY - HAVING - SELECT - ORDER BY
FROM - WHERE - GROUP BY - HAVING - SELECT - ORDER BY
FROM - WHERE - GROUP BY - HAVING - SELECT - ORDER BY
FROM - WHERE - GROUP BY - HAVING - SELECT - ORDER BY
FROM - WHERE - GROUP BY - HAVING - SELECT - ORDER BY
FROM - WHERE - GROUP BY - HAVING - SELECT - ORDER BY
FROM - WHERE - GROUP BY - HAVING - SELECT - ORDER BY
FROM - WHERE - GROUP BY - HAVING - SELECT - ORDER BY
FROM - WHERE - GROUP BY - HAVING - SELECT - ORDER BY
FROM - WHERE - GROUP BY - HAVING - SELECT - ORDER BY
FROM - WHERE - GROUP BY - HAVING - SELECT - ORDER BY
FROM - WHERE - GROUP BY - HAVING - SELECT - ORDER BY