select * from (
select usertypecrop from (SELECT regexp_substr(usertypecrop, '[^,]+', 1, rownum) usertypecrop,rownum FROM (SELECT usertypecrop FROM mini_user lecm WHERE usertype is not null ) CONNECT BY rownum <=(SELECT regexp_count(usertypecrop, ',')+1 FROM dual)) group by usertypecrop order by count(usertypecrop) desc
) w
left join (SELECT usertypecrop FROM mini_user) s on w.usertypecrop like s.usertypecrop
oracle将逗号隔开数据转换为行结构
最新推荐文章于 2024-07-30 10:23:55 发布
该篇文章详细描述了一个SQL查询过程,从mini_userlecm表中通过正则表达式提取usertypecrop字段,按出现次数进行分组并排序,然后与mini_user表中的usertypecrop进行连接,旨在获取和分析用户类型数据。
摘要由CSDN通过智能技术生成