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 get the first occurrence of the 5 digits in a string

Rajan SwMay 29 2019 — edited May 29 2019

Hi,

I have a string like below and I want to get the first occurrence 5 digits(exact 5 digits) from the string.

From this :  '12345 Munising MI 498621111114325  54688 795735737 This is the full address of the place'

The output should be 12345 as this is the first occurrence of 5 digited number

From this 'Munising MI 498621111114325  54688 795735737 This is the full address of the place'

it should be 54688 as this is the first occurrence of 5 digited number

I am using Oracle 12c R2

Thanks in advance

Comments
Post Details
Added on May 29 2019
6 comments
1,488 views