查询:

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

最佳答案

使用 LISTAGG

SELECT LISTAGG(o.candidateid) WITHIN GROUP () .....
  • SEE SQLFiddle Demo
  • 关于sql - 需要逗号分隔的输出以获取多行查询,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/13181692/

    10-12 01:07