标签:
--b.resdepartment保存的是是逗号分隔的员工ID,例如‘99001,99002,99003‘
--sprt_orgobject 表保存了每个员工ID对应的员工姓名
--wm_concat函数在11g及以后将无法正常使用
select
(select wm_concat(orgname) from sprt_orgobject where orgid in (
select replace(regexp_substr(b.resdepartment,‘[^,]+‘,1,level),‘,‘,‘ ‘) c1 from dual
connect by level<=length(b.resdepartment)-length(replace(b.resdepartment,‘,‘,‘‘))+1)) 员工姓名
from buy_ys_productelements b
标签:
原文地址:http://www.cnblogs.com/duelsol/p/4952601.html