日期:2014-05-16  浏览次数:20502 次

oracle 10g以上版本的wmsys.wm_concat
查询多行的时候 用‘,’组合多行成一个字符串

select UNITID,wmsys.wm_concat(CAPA_GROUP) CAPA_GROUP from
(select distinct pu.unitid,cgb.capa_group from ProdUnit pu, ProdUnitExtDF pud , CapaGrpBility cgb , UnitCap uc
where  pu.unitid = pud.eqpid and pud.capability = cgb.capability and pu.unitid = uc.eqpid and uc.capability = pud.capability
and pud.menustatus = '1'  and uc.isavail = 'T'
order by  pu.unitid)
group by UNITID;