title: Replace a character at N position in a string
body: <p>I want to replace a character at N position in a string. This my query:</p>
  
  <pre><code>SELECT code FROM tablecodes
  </code></pre>
  
  <p>The result is 3 rows:</p>
  
  <pre><code>AXGETYTRTFYZUFYZFFFDIZEG
  GFYZUFYZFAXFCDIZAX
  ZUFYZGEFYFAXFFIXZRA
  </code></pre>
  
  <p>I can't figure out how to replace the last 'Z' character on each row with 'A'. I want the result to look like this:</p>
  
  <pre><code>AXGETYTRTFYZUFYZFFFDIAEG
  GFYZUFYZFAXFCDIAAX
  ZUFYZGEFYFAXFFIXARA
  </code></pre>
  
  <p>The 'Z' character is always in the same position (length of the string - 3)</p>
  
  <p>Any suggestions?
  Thanks.</p>