Oracle-按级别连接

时间:2018-12-10 20:00:12

标签: connect-by

我有这个查询:

WITH t AS (SELECT '1:300:238:Regular:1:month' AS txt FROM dual)
SELECT LEVEL, REGEXP_SUBSTR (txt, '[^:]+', 1, LEVEL) AS word
FROM t
CONNECT BY LEVEL <= LENGTH(regexp_replace(txt,'[^:]+'))+1
ORDER BY 1;

它返回6行,每个元素在不同的行上。如何将其旋转为1行,6列,以便实际上可以在代码中将其选择为变量?

非常感谢!

0 个答案:

没有答案