title: SQL count returning wrong values
body: <p>Was asked the question in regards to a olympic database. </p>
  
  <p>"For each competitor who was in more than one event, list their given-name, family-name, their number of events, and their best and worst places (and no other data). 
  List this information in in descending order of their number of events (i.e. most events first), 
  and (when competitors have the same number of events) then in ascending order of best place, 
  and (when the same best place) then in ascending order of worst place, 
  and (when the same worst place) then in ascending order of their family-name."</p>
  
  <p>I have been trying to write the query to do this, however it does not return the correct count. It stops at a count of 2 and does not return the correct min or max values.
  The Tables are:</p>
  
  <p>Competitors Table</p>
  
  <pre><code>Competitornum | Givenname | Familyname | Gender | Dateofbirth | CountryCode | 
  </code></pre>
  
  <p>Results Table has </p>
  
  <pre><code>Eventid | Competitornum | Place | Lane | Elapsedtime | Note |
  </code></pre>
  
  <p>Query</p>
  
  <pre><code>SELECT c.Givenname, Familyname, COUNT(r.Competitornum), MIN(r.Place), MAX(r.Place)
  FROM Competitors c
  JOIN Results r 
  ON c.Competitornum=r.Competitornum
  Group by c.Givenname, familyname, place
  Having Count(r.Competitornum) &gt; 1
  </code></pre>
  
  <p>This is the query I have come up with so far and am not sure what I have wrong.</p>