Thursday, May 23, 2024

Oracle SQL: Extracting text between two characters

I had similar kind of Requirement which was we have to display text only occurs in between colon and hypen (":" and "-") so I used below line which worked successfully 

    LTRIM(RTRIM(TRIM (BOTH ':' FROM REGEXP_SUBSTR({fieldname}, ':[^-]+'))))

Example line

**Computer, Internet & Software: Atlassian - Business Software**


then the ouctcome was

**Atlassian** 


this Formula i have used inside a saved search result in NetSuite Environment 

No comments:

Post a Comment