title: SQL - Redshift remove duplicate rows without primary key
body: <p>I have a big redshift database.
  the records do not have unique key.</p>
  
  <p>I'd like to convert the below sql to postgresql.</p>
  
  <pre><code>DELETE FROM (
  SELECT *,ROW_NUMBER() OVER (partition BY column1, column2, column3) AS rnum
  FROM tablename ) t1
  WHERE t1.rnum &gt; 1;
  </code></pre>
  
  <p>perform the above sql,the following errors appear :</p>
  
  <blockquote>
    <p>Amazon Invalid operation: syntax error at or near "(";</p>
  </blockquote>
  
  <p>please :'( .</p>