title: select most recent records with unique user id
body: <p>I have a database table that contains multiple entries for each user during a period of time. The query I'm trying to build will only return the most recent record for each user during that time period.</p>
  
  <p>what I have thus far:</p>
  
  <pre><code>SELECT *
  FROM (SELECT DISTINCT * FROM picks_recorded)
  WHERE date_submitted &gt; '" . $week_start . "'
  AND date_submitted &lt; '" . $week_end . "'
  ORDER BY date_submitted DESC
  LIMIT 1;
  </code></pre>
  
  <p>I've tried several versions of this without success.</p>