title: Teradata search for a string in reverse order
body: <p>We're doing a conversion from MS SQL.
  The original code is</p>
  
  <blockquote>
    <p>reverse(ltrim(rtrim(substring(reverse("string"),1,(charindex('
    ',reverse("string")))))))</p>
  </blockquote>
  
  <p>So what it does is that it searches for a string at the end until when it finds a space, it gets that string as its value</p>
  
  <p>EX. </p>
  
  <p><strong>'ABCD 123' the result is '123'</strong></p>
  
  <p><strong>'STEP 12 3-2' the result is '3-2'</strong></p>
  
  <p>So far I have this SELECT substr('ABCDE 1234', character('ABCDE 1234')-2) 
  but don't know how to do a reverse search in Teradata :(</p>