1

I need to extract a string from a given set of string. The string given is :

Data string 1 : LOAD TEST ABC,2146520,9856452147
Data string 2 : LOAD TEST:804749:9756325874

Here, the string set has a static value "LOAD TEST ABC" and "LOAD TEST", here i need to extract the string from the middle 2146520 and 804749 as an Id.

1 Answer 1

1

You might be able to use REGEXP_SUBSTR here with a capture group:

SELECT col, REGEXP_SUBSTR(col, '[,:](.+?)[,:]', 1, 1, NULL, 1) AS middle_num
FROM yourTable;

screen capture from demo link below

Demo

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.