I have a column whose values consist of a prefix and then some value, for example:
ABC-Car
ABC-Dog
ABC-Suit
CBR-Train
In my request, I would like to trim some prefixes, for example. if I trimmed "ABC-", it would give me the following:
Car
Dog
Suit
CBR-Train
The only problem: all characters are valid for the part after the prefix. Perhaps I could:
ABC-ABC-Cat
I want to return this trimmed value:
ABC-Cat
The TRIM and LTRIM functions seem to use pattern / character matching rather than a single line match. Is there a way to accomplish what I want with any of these functions or with another built-in function?
, CASE , , SUBSTR , . , .