【问题标题】:Need Comma seperated output for a query fetching mutiple rows获取多行的查询需要逗号分隔的输出
【发布时间】:2012-11-01 16:44:57
【问题描述】:

查询:

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

【问题讨论】:

    标签: sql plsql oracle11g


    【解决方案1】:

    使用LISTAGG

    SELECT LISTAGG(o.candidateid) WITHIN GROUP () .....
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-10-16
      • 2022-01-04
      • 2012-10-22
      相关资源
      最近更新 更多