| SELECT TRIM(REGEXP_SUBSTR(your_column, '[^,]+', 1, LEVEL)) AS split_value | | FROM your_table | | CONNECT BY REGEXP_SUBSTR(your_column, '[^,]+', 1, LEVEL) IS NOT NULL | | AND PRIOR your_column = your_column | | AND PRIOR SYS_GUID() IS NOT NULL | | AND ROWNUM <= REGEXP_COUNT(your_column, ',') + 1; |
更新 | SELECT TRIM(REGEXP_SUBSTR(your_column, '[^,]+', 1, LEVEL)) AS split_value | | FROM your_table | | CONNECT BY REGEXP_SUBSTR(your_column, '[^,]+', 1, LEVEL) IS NOT NULL | | AND PRIOR your_unique_column = your_unique_column -- 使用表的唯一列来避免跨行递归 | | AND PRIOR SYS_GUID() IS NOT NULL | | AND LEVEL <= REGEXP_COUNT(your_column, ',') + 1; |
|