I would like to remove trailing characters from a string using an Oracle regular expression.
My data looks like this:
TDC Supervisor #
TDC Supervisor ##
TDC Supervisor ###
Store Manager - 1
Store Manager - 2
Store Manager - 3
Stockroom Clerk Flexi 100 Hrs
Sales Consultant Flexi 120 Hrs
Service Desk Consultant (5 Day)
Secretary
I would like to get rid of the trailing # and - 1, but not the 120 Hrs and the 5 Day. Is there a way to do this using an Oracle regular expression. Not sure whether I should use REGEXP_SUBSTR or REGEXP_REPLACE.
So basically I would like to do a distinct that returns:
TDC Supervisor
Store Manager
Stockroom Clerk Flexi 100 Hrs
Sales Consultant Flexi 120 Hrs
Service Desk Consultant (5 Day)
Secretary