Skip to Main Content

Oracle Database Discussions

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!

Regular expression to fetch all records that start with certain string excluding specific text

Prani NKOct 18 2024

I need to retrieve all records in a table where employeeid starts with a specific string excluding the records with a particular string anywhere in the id.

For example, below is my table data.

EmployeeID Name

AA5TRS31 XXXX

AA5h1234 yyyyy

AA5g5688 zzzz

AA5TRS33 dahg

I need records where EmployeeID starts with ‘AA5’ but does not contain ‘TRS’ using REGEXP_LIKE

Comments
Post Details
Added on Oct 18 2024
1 comment
223 views