SELECT I.ANIMAL_ID, I.NAME FROM ANIMAL_OUTS O JOIN ANIMAL_INS I ON O.ANIMAL_ID = I.ANIMAL_ID WHERE I.DATETIME > O.DATETIME ORDER BY I.DATETIME;