列转行函数使用SQL
select down.downparaversionid || '|' || e.unionno,
创新互联长期为1000多家客户提供的网站建设服务,团队从业经验10年,关注不同地域、不同群体,并针对不同对象提供差异化的产品和服务;打造开放共赢平台,与合作伙伴共同营造健康的互联网生态环境。为海口企业提供专业的网站建设、网站设计,海口网站改版等技术服务。拥有10多年丰富建站经验和众多成功案例,为您定制开发。
down.downparaversion,
e.unionno,
listagg(o.organname, ',') within group(order by e.organno) a1,
listagg(case
when e.yctorganno is null then
''
when e.yctorganno = 'null' then
''
else
e.yctorganno
end,
',') within group(order by e.organno) a2,
e.defineid,
to_char(e.definedate, 'yyyy-mm-dd'),
e.auditid,
to_char(e.auditdate, 'yyyy-mm-dd'),
e.auditstatus
from tb_empcardunion e, tb_downparaversion down, tb_organ o
where e.downparaversionid = down.downparaversionid
and e.organno = o.organno
group by down.downparaversionid,
down.downparaversion,
e.unionno,
e.defineid,
to_char(e.definedate, 'yyyy-mm-dd'),
e.auditid,
to_char(e.auditdate, 'yyyy-mm-dd'),
e.auditstatus
网页题目:列转行函数使用SQL
标题网址:http://cdiso.cn/article/johgos.html