Skip to content

Instantly share code, notes, and snippets.

@bhochieng
Created November 24, 2021 05:14
Show Gist options
  • Save bhochieng/0dda2e5b4a4d9989880ab1d825886fbf to your computer and use it in GitHub Desktop.
Save bhochieng/0dda2e5b4a4d9989880ab1d825886fbf to your computer and use it in GitHub Desktop.
split comma delimited string
SELECT REGEXP_SUBSTR ('23,34,45,56','[^,]+',1,1) as "token"
FROM DUAL
/
SELECT REGEXP_SUBSTR ('23,34,45,56','[^,]+',1,2) as "token"
FROM DUAL
@bhochieng
Copy link
Author

If you need to split '.' delimited string use,
SELECT REGEXP_SUBSTR ('23.34.45.56','[^.]+',1,1) as "token"
FROM DUAL
/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment