select t1.* from V_Forp_User t1 where t1.state= ‘1’ and t1.FK_DomainID= 1 and ( t1.id in ( SELECT REGEXP_SUBSTR(a.id, ‘[^,]+’, 1, rownum) as f_value_066 from (select to_char(wm_concat(to_char(pb.userId))) as id
from (SELECT a.id, REGEXP_SUBSTR(a.f_value_066, ‘[^,]+’, 1, rownum) as f_value_066
from (select to_char(wm_concat(to_char(b.id))) id, to_char(wm_concat(to_char(b.f_value_066))) as f_value_066 from zdy_form_059 b
where b.id = 1984) a
connect by rownum <=
LENGTH(a.f_value_066) - LENGTH(regexp_replace(a.f_value_066, ‘,’, ‘’)) + 1) b
left join (select wm_concat(userId) userId, groupinfo from PRJ_BUIBINFO
where ISBUORIB = ‘1’ group by groupinfo) pb
on pb.GROUPINFO = b.f_value_066
where b.id = 1984) a connect by rownum <= LENGTH(a.id) - LENGTH(regexp_replace(a.id, ‘,’, ‘’)) + 1 ) )
oracle聚合+行转列查询
最新推荐文章于 2024-03-15 16:17:03 发布