Can anyone please explain to me why I'm getting this error, where I'm wrong and what to do in future to avoid it.
SELECT a.*, row_number() over (partition by code_employee order by
to_date(substr(last_located_time,1,10),'yyyy-mm-dd')) rn
FROM
(SELECT LAST_LOCATED_TIME, NAME_COMMON, CODE_EMPLOYEE
FROM
daily_report
WHERE INSERT_DATE = TRUNC (SYSDATE-3) AND DEVICE_NAME LIKE '%SM-T116IR')a
WHERE rn=1;