Last active
April 7, 2020 13:27
-
-
Save aykononov/4655f526c2a952c558182a6dddf8178e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Задана строка '1,2,3,4', необходимо, используя регулярные выражения в запросе получить результат: | |
C1 C2 C3 C4 | |
-- -- -- -- | |
1 2 3 4 | |
*/ | |
SELECT regexp_substr(t.str,'[^,]+',1,1) as c1, | |
regexp_substr(t.str,'[^,]+',1,2) as c2, | |
regexp_substr(t.str,'[^,]+',1,3) as c3, | |
regexp_substr(t.str,'[^,]+',1,4) as c4 | |
FROM (SELECT '1,2,3,4' AS str FROM dual) t; |
Author
aykononov
commented
Nov 11, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment