title: I need to find the Nth instance of something
body: <p>I'm writing a T-SQL database to help me identify trends with football (soccer) statistics.</p>
  
  <p>I've got several rows of data per match, each row signifying an event such as a goal, or a corner.</p>
  
  <p>I'm trying to work out who wins the corner races for each match to 3, 5, 7 &amp; 9 corners.</p>
  
  <p>I just cannot even think of a method to employ for this. Can anyone help?</p>
  
  <p>I've tried looking at case statements and temp tables, but just can't find a way to get what I want</p>
  
  <p>The data would look something like this </p>
  
  <pre><code>Event   Team    Time (mins)
  corner  home    32
  corner  home    78
  corner  away    86
  corner  home    12
  corner  away    89
  corner  away    36
  </code></pre>
  
  <p>So I would want to find the 3rd, 5th, 7th and 9th instance (if they exist) of each home corner and the same for the away corners.  The lower of the two times for each category would therefore win the race if that makes sense.  </p>
  
  <p>In the above example the Home team would win the race because it's third corner occurred in the 78th minute, whereas the third away corner was in the 89th minute.</p>