title: SQL query to find the most recent timestamp for several ID's
body: <p>I'm trying to run a query that returns the last 'game' or action that a certain group of users performed. I've had to join several tables to finally get what I want, but this basically returns each users games now. I'd like to just take their last game. I added max(___) to timestamp in the query but it ended up just returning the most recent game played and that is it. Ideally I'd like to see each user and their last action.</p>
  
  <pre><code>SELECT teamName, test_teams.userID, test_teams.timestamp AS signup, sponsorship, test_results.timestamp, stadium, win+draw+lose AS games 
      FROM test_teams 
  INNER JOIN test_profile
      ON test_teams.userID = test_profile.userID
  INNER JOIN test_results
      ON test_teams.userID = test_results.homeTeamId
  WHERE test_teams.timestamp &gt;= '2015-11-04 00:00:00' and win+draw+lose &gt; 100
  ORDER BY games desc;
  </code></pre>