Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to extract a particular portion of a string in sql query

VimalPSJan 24 2019 — edited Jan 30 2019

Hi ,

I have a query in hand where in i need to get a bit tricky result as output.

The query is :-

with t as(select '\n\nTest: 01if055053yu.demo.com sduinu 478 Value: 91.2 <= 120\n\n metadata rest:34rjudo\uki 256 adsd Value: 91.2 <= 120 yh237*hdu:udnk' col1 from dual union all

      select '\\n\\nTest: 2wedrfyu.trsthji76e 2898kl 34 yhcjk Value: 94 \<= 120  \\n metadata host:err  690 ud45o\\udssdsd Value: 94 \<= 120  \\nritujku73yhrt ' from dual  union all

      select '\\n\\nTest: 2wedrfyu.trsd23thji76eyhcjk Value: 23.4567 \<= 120qwedr metadata think:3rjuffdo\\ukiwsd Value: 23.4567 \<= 120qwe erff' from dual

     )

select col1 from t;

From this data set i need to make an output which look like this

pastedImage_0.png

Is there a way i can achieve it through any mechanism in oracle. I tried to achieve it regex_substr but failed in most of the scenarios. And, i'm bit confused in how to use it also.

Can you guys help on this, please..

Thanks

This post has been answered by Frank Kulash on Jan 29 2019
Jump to Answer
Comments
Post Details
Added on Jan 24 2019
11 comments
1,019 views