I’m newbie in plsql.
I’m getting error
ORA-01422: exact fetch returns more than requested number of rows
The problem is that from time to time I need to select from cursor that have duplicate rows
To avoid this situation I tried to add
rownum=1 or rownum<2
But this didn’t solve the issue
select work into my_work
from INFO
where person_id = in_person_id
and date= (select max(date) from INFO where (person_id = in_person_id and rownum<2
));
P.S. the original bug produce duplicate rows cannot be fixed
Your
rownum <2applied to subquery, not to the main one. It should be