Skip to content

Split a string by comma into columns in Oracle SQL

SELECT  REGEXP_SUBSTR (str, '[^,]+', 1, 1)    AS Col1
,       REGEXP_SUBSTR (str, '[^,]+', 1, 2)    AS Col2
,       REGEXP_SUBSTR (str, '[^,]+', 1, 3)    AS Col3
,       REGEXP_SUBSTR (str, '[^,]+', 1, 4)    AS Col4
FROM    table_x
See also  Update random values from a list into a column in MySQL

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.