title: Handling dups returned from a query
body: <p>I have the below query that returns a few duplicates. </p>
  
  <pre><code>SELECT DISTINCT number, owner, date, provider FROM
  data.provider
  </code></pre>
  
  <p>Output - </p>
  
  <pre><code>"05"    "Government - State/ County"    "1966-07-01"    "H"
  "05"    "Proprietary"                   "1966-07-01"    "H"
  "67"    "Proprietary"                   "2002-12-16"    "H"
  </code></pre>
  
  <p>I want the query to return only one record for duplicate <code>number</code> column records. So, I want this output instead - </p>
  
  <pre><code>"05"    "Government - State/ County"    "1966-07-01"    "H"
  "67"    "Proprietary"                   "2002-12-16"    "H"    
  </code></pre>
  
  <p>I want it to distinguish between the two "05" records based on the year of the record. The latest year wins. Year is part of the <code>provider</code> table.</p>