oracle sql ,分隔的字段行转列查询
作者:互联网
--将查询的,分隔的字段从行转成列
select REGEXP_SUBSTR(ids, '[^,]+', 1, rownum) AS ids from ( select listagg(ids, ',') WITHIN GROUP ( ORDER by ID) ids from t_table ) connect by rownum <= (SELECT regexp_count(ids, ',') + 1 FROM dual);
--解释
t_table 为表名称
ids为,分隔的字段
标签:分隔,段行,--,ids,转列,sql,table,rownum,select 来源: https://www.cnblogs.com/1427wsl/p/15832338.html