title: How can I trim a prefix string in an Oracle SQL query?
body: <p>I have a column whose values consist of a prefix and then some value, e.g.:</p>
  
  <pre><code>ABC-Car
  ABC-Dog
  ABC-Suit
  CBR-Train
  </code></pre>
  
  <p>In my query I would like to trim off certain prefixes, e.g. if I trimmed off 'ABC-' it would give me the following:</p>
  
  <pre><code>Car
  Dog
  Suit
  CBR-Train
  </code></pre>
  
  <p>The only problem is, all characters are valid for the part after the prefix.  So it's possible I could have:</p>
  
  <pre><code>ABC-ABC-Cat
  </code></pre>
  
  <p>I want this trimmed value to return:</p>
  
  <pre><code>ABC-Cat
  </code></pre>
  
  <p>The TRIM and LTRIM functions appear to use pattern/character matching rather than once-only string matching.  Is there a way to accomplish what I want with either of these functions or with another built-in function?</p>
  
  <p>Currently I'm thinking I'll have to use a CASE statement to check for that prefix at the beginning of each value and if it exists, SUBSTR it off, else return the column unchanged.  Hoping there is a simpler way.</p>