--将查询的,分隔的字段从行转成列
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为,分隔的字段
2022-01-08 23:57:19
--将查询的,分隔的字段从行转成列
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为,分隔的字段