SELECT a.union_code,
(select count(1)
from UNION_MEMBER um
where um.delete_flag = '0'
and um.member_union_code in
(select ubi.union_code
from union_base_info ubi
where ubi.union_delete = '0'
start with ubi.union_code = a.union_code//找不到
connect by prior ubi.union_code =
ubi.superior_union)
) as UNION_MEMBER_NUM
FROM UNION_BASE_INFO a
where a.SUPERIOR_UNION = '0000000000'
现在想用存储过程处理 但是不懂怎么写 求大佬指导