Query:
select o.candidateid
from onboardingcandidates o, candidatedetails c
where o.candidateid=c.candidateid
and o.JOININGSTATUS='0091'
and to_date(o.joiningdate)=to_date(sysdate+5);
Output:
cand1
cand2
cand3
cand62
Required Output:
cand1, cand2, cand3, cand62