title: How to delete duplicates in sql where min(timestamp)
body: <p>I need to delete duplicate lines, leaving only the most updated ones</p>
  
  <p>e.g.: <code>SCHEMA: user_id, conversation_id, created_at, updated_at</code></p>
  
  <p>DATA SAMPLE:</p>
  
  <pre><code>Row user_id conversation_id          created_at                  updated_at
  1    234        45664        2020-06-05 16:17:01 UTC    2020-06-05 23:27:01 UTC        
  2    234        45664        2020-06-05 16:17:01 UTC    2020-06-06 14:34:01 UTC
  3    232        45665        2020-06-05 17:23:41 UTC    2020-06-05 18:12:01 UTC
  4    232        45665        2020-06-05 17:23:41 UTC    2020-06-07 12:47:01 UTC
  </code></pre>
  
  <p>I want to keep only the most updated row:</p>
  
  <pre><code>   Row user_id conversation_id          created_at                  updated_at
  
      1    234        45664        2020-06-05 16:17:01 UTC    2020-06-06 14:34:01 UTC
      2    232        45665        2020-06-05 17:23:41 UTC    2020-06-07 12:47:01 UTC
  </code></pre>
  
  <p>I tried:</p>
  
  <pre><code>DELETE * FROM my_table
  WHERE conversation_id IN (SELECT conversation_id FROM my_table
  HAVING count(conversation_id) = 2
  GROUP BY 1)
  AND min(updated_at)
  </code></pre>