title: Postgres Query to delete duplicated rows by many parameters
body: <p>I have a table with fields: Guide, FileSource, CodeName. All these fields are of text type. Some fields have the same values, and sometimes the values are NULL. I made query which deletes duplicate rows with the same parameters, however, when some values equal NULL there is nothing deleted rows. How could I change the query that will delete rows with the same parameters include values equal NULL?</p>
  <pre><code>DELETE FROM public.TableName as T1
  USING public.TableName as T2
  WHERE T1.ctid &gt; T2.ctid
  AND T1.&quot;Guide&quot; = T2.&quot;Guide&quot;
  AND T1.&quot;FileSource&quot; = T2.&quot;FileSource&quot;  
  AND T1.&quot;CodeName&quot; = T2.&quot;CodeName&quot;;
  </code></pre>