I have a data field in an Oracle 12cR1 database. The field is a product descriptor, and the start of the field contains the product ID. It is then followed by the product name. I need to strip off the Product ID. The product ID can be in one of 2 formats... The data typically looks like one of the following:
- 0P3H - Opus NEM
- 0P22 - 40021 - Order Capture Self Service
Note that there are some cases where the '-' character is part of the product name, such as
- 0C34 - HR - Promotions Module
As far as I can tell, I need to delete the following WHEN IT IS AT THE START OF THE STRING...
- 4 characters then space then dash then space
- 4 characters then space then dash then space 5 characters space dash space
How would I write Oracle SQL to read a field and REMOVE these 2 different substrings?
Thanks!