Wednesday, February 12, 2020

Divide string in Rows format using REGEXP_SUBSTR

Using REGEXP_SUBSTR we will separate string in rows

Example:

String: 'Sunil|Darshan|Rahul|Ritesh|Pravin|Preetam'  -- you will replace with Variable or field or other string.

Separator: |   -- you will use another symbol (eg. $, #, comma(,) etc.)


SELECT regexp_substr('Sunil|Darshan|Rahul|Ritesh|Pravin|Preetam','[^|]+', 1, LEVEL) Employee_Name
FROM dual
CONNECT BY regexp_substr('Sunil|Darshan|Rahul|Ritesh|Pravin|Preetam', '[^|]+', 1, LEVEL) IS NOT NULL;

Output: 

No comments:

Post a Comment

Query to get Concurrent Program Data Template details

 SELECT  fcpt.user_concurrent_program_name       , fcp.concurrent_program_name       , fet.user_executable_name executable_name       , fe....