title: Deleting entries with very small time interval
body: <p>I have a table where it gets entries updated by time for every resource. For simplicity lets say the table has these essential columns</p>
  
  <p>-resourceid<br>
  -entrytime</p>
  
  <p>For some reasons the there has been multiple entries on the table for many resourceid (s) within few milliseconds and i want to remove the second entry that has been recorded so.</p>
  
  <p>I queried to find such entries by making a self join on the table to find the entries. </p>
  
  <pre><code>select b.resourceid,b.entrytime 
  from RESOURCE_DATA_TABLE a 
     join RESOURCE_DATA_TABLE b on a.resourceid=b.resourceid 
  where b.collectiontime &gt; a.entrytime 
    and b.entrytime &lt; (a.entrytime + interval '4 millisecond');
  </code></pre>
  
  <p>But how do I delete them on a single shot.</p>