title: Distinct on one column only in Oracle
body: <p>I would like to use distinct on the following table, but only on the 'PlayerID' column. This is what I have at the moment:</p>
  
  <pre><code>   MATCHID   PLAYERID     TEAMID MATCHDATE STARTDATE
  ---------- ---------- ---------- --------- ---------
          20          5          2 14-JAN-12 01-JUN-11
          20          5          4 14-JAN-12 01-JUN-10
          20          7          4 14-JAN-12 01-JUN-11
          20          7          2 14-JAN-12 01-JUN-10
          20         10          4 14-JAN-12 01-JUN-11
          20         11          2 14-JAN-12 01-JUN-10
          20         13          2 14-JAN-12 01-JUN-11
          20         16          4 14-JAN-12 01-JUN-10
          20         17          4 14-JAN-12 01-JUN-10
          20         18          4 14-JAN-12 01-JUN-10
          20         19          2 14-JAN-12 01-JUN-11
  </code></pre>
  
  <p>And this is what I want, so that the highest 'StartDate' for each 'PlayerID' is shown and the next row ignored:</p>
  
  <pre><code>   MATCHID   PLAYERID     TEAMID MATCHDATE STARTDATE
  ---------- ---------- ---------- --------- ---------
          20          5          2 14-JAN-12 01-JUN-11
          20          7          4 14-JAN-12 01-JUN-11
          20         10          4 14-JAN-12 01-JUN-11
          20         11          2 14-JAN-12 01-JUN-10
          20         13          2 14-JAN-12 01-JUN-11
          20         16          4 14-JAN-12 01-JUN-10
          20         17          4 14-JAN-12 01-JUN-10
          20         18          4 14-JAN-12 01-JUN-10
          20         19          2 14-JAN-12 01-JUN-11
  </code></pre>
  
  <p>Current SQL:</p>
  
  <pre><code>SELECT pi.MatchID, pi.PlayerID, t.TeamID, m.MatchDate, pf.StartDate
  FROM Plays_In pi, Match m, Plays_A pa, Team t, Plays_For pf, Made_Up_Of muo, Season s
  WHERE pi.MatchID = m.MatchID
  AND m.MatchID = pa.MatchID
  AND pa.TeamID = t.TeamID
  AND pf.PlayerID = pi.PlayerID
  AND pf.TeamID = t.TeamID
  AND muo.MatchID = pi.MatchID
  AND muo.SeasonID = s.SeasonID
  AND pi.MatchID = '&amp;match_id'
  AND m.MatchDate &gt;= pf.StartDate
  ORDER BY pi.MatchID ASC, pi.PlayerID ASC, pf.StartDate DESC;
  </code></pre>
  
  <p>It's an Oracle database.</p>
  
  <p>Thanks in advance.</p>