title: TSQL mode (as in mean, median,mode)
body: <p>I'm trying to calculate the mode of a series of idsofInterest in a table, each with an accompanying valueOfInterest such:</p>
  <pre><code>idsOfInterest | valueOfInterest  
  2             | 1A  
  2             | 1A  
  2             | 3B  
  1             | 2A  
  1             | 2C  
  1             | 2A  
  4             | 3B  
  4             | 3B  
  4             | 4C  
  </code></pre>
  <p>but with millions of rows.<br />
  Each list of idOfInterest is sufficiently long that multimodes are not a problem. Ideally, I would like something like</p>
  <pre><code>idsOfInterest | modeValueOfInterest  
  1             | 2A  
  2             | 1A  
  3             | 3C  
  4             | 3B
  </code></pre>