title: Select distinct on multiple columns simultaneously, and keep one column in PostgreSQL
body: <p>For a table such as this:</p>
  
  <pre><code>tblA  
  
  A,B,C  
  1,2,t3a  
  1,3,d4g  
  1,2,b5e  
  1,3,s6u 
  </code></pre>
  
  <p>I want to produce a table that selects distinct on both A and B simultaneously, and still keep one value of C, like so:</p>
  
  <pre><code>tblB  
  
  A,B,C  
  1,2,t3a  
  1,3,d4g 
  </code></pre>
  
  <p>Seems like this would be simple, but not finding it for the life of me.</p>
  
  <pre><code>DROP TABLE IF EXISTS tblA CASCADE;  
  SELECT DISTINCT ON (A,B), C  
  INTO tblB  
  FROM tblA;  
  </code></pre>