把字段的值作为in条件进行查询

select
        FUSHENPEOPLE,
        (
                select
                        wm_concat(user_name)
                from
                        sys_user
                where
                        user_id in --in外层语句
                        (
                                select DISTINCT
                                        regexp_substr(FUSHENPEOPLE //需要处理的字段, '[^,]+', 1, LEVEL) as id CONNECT BY LEVEL <= LENGTH(FUSHENPEOPLE//需要处理的字段) - LENGTH(REGEXP_REPLACE(FUSHENPEOPLE//需要处理的字段, ',', '')) + 1
                        )
        )as FUSHENPEOPLENAME
from
        BJYQ_KFJD_JOB

你可能感兴趣的:(数据库,sql,mysql)