一个表字段中存了id,并以逗号分隔,id对应的详细信息在另一个表中,取其中逗号分隔的id对应表字段的名称写法,
select
u.job_id,
(select dept_name from dept_t where dept_id =u.dept_id) dept_name,
u.month,
u.title,
(select to_char(wmsys.wm_concat(t.dept_name)) from cl_sys_dept_t t where t.dept_id in(SELECT REGEXP_SUBSTR (u.co_depts,'[^,]+',1,LEVEL) FROM dual CONNECT BY REGEXP_SUBSTR (u.co_depts,'[^,]+',1,LEVEL) IS NOT NULL)) co_depts
from jobs_dept_t u
浙公网安备 33010602011771号