title: Replacing single quote characters in a column in Amazon Redshift
body: <p>I have some data in a table in the following format in <code>Amazon Redshift</code>:</p>
  
  <pre><code>Column1    Column2
  'a'          'b'
  </code></pre>
  
  <p>I'd like to remove the single quote characters from this table and get the data as follows:</p>
  
  <pre><code>Column1    Column2
  a            b
  </code></pre>
  
  <p>I would have thought the <code>Replace</code> function would do the trick, so I wrote the following query:</p>
  
  <pre><code>select replace(column1,''',''),
         replace(column2,''','')
  from table
  </code></pre>
  
  <p>But this doesn't work and gives me <code>Amazon](500310) Invalid operation: unterminated quoted string at or near "''','')</code>. I tried to escape the single quote character by <code>\</code> but even that didn't work.</p>
  
  <p>I also tried using the following query:</p>
  
  <pre><code>select replace(column1,"'",''),
             replace(column2,"'",'')
      from table
  </code></pre>
  
  <p>But it gave me the error <code>[Amazon](500310) Invalid operation: column "'" does not exist in &lt;tablename&gt;</code></p>
  
  <p>So how do I remove these single characters from my data?</p>
  
  <p>Any help would be much appreciated.</p>
  
  <p>TIA.</p>