Deleting duplicates rows from redshift
<p>I am trying to delete some duplicate data in my redshift table.</p>

<p>Below is my query:-</p>

<pre><code>With duplicates
As
(Select *, ROW_NUMBER() Over (PARTITION by record_indicator Order by record_indicator) as Duplicate From table_name)
delete from duplicates
Where Duplicate &gt; 1 ;
</code></pre>

<p>This query is giving me an error. </p>

<blockquote>
  <p>Amazon Invalid operation: syntax error at or near "delete";</p>
</blockquote>

<p>Not sure what the issue is as the syntax for with clause seems to be correct.
Has anybody faced this situation before?</p>