title: PostgreSQL select rows with specific columns identical
body: <p>I need to get rid of rows that have the same value in only specific columns. For instance, in the extract below, I would like to select all the rows except the last one which is equal to the second-to-last row for columns CODE, START_DATE and TYPE (this means ignoring the value for END_DATE column).   </p>
  
  <pre><code>  code         | start_date     | end_date     | type
  ---------------+----------------+--------------+------
  C086000-T10001 | 2014-11-11     | 2014-11-12   | 01
  C086000-T10001 | 2014-11-11     | 2014-11-11   | 03
  C086000-T10002 | 2014-12-03     | 2014-12-10   | 03
  C086000-T10002 | 2014-01-03     | 2014-01-04   | 03
  C086000-T10003 | 2012-02-27     | 2014-02-28   | 03
  C086000-T10003 | 2014-08-11     | 2014-11-12   | 01
  C086000-T10003 | 2014-08-11     | 2014-08-20   | 01
  </code></pre>
  
  <p>How could I perform this?</p>
  
  <p><strong>Edit:</strong> The following query returns a <em>too much columns for a subquery</em> error message:</p>
  
  <pre><code>SELECT * FROM my_table WHERE code NOT IN (SELECT DISTINCT code, start_date, type FROM my_table) ;
  </code></pre>
  
  <p>Many thanks for help!</p>