title: Determining % agreement in SQL Server
body: <p>I'm trying to figure out how to determine the percentage of time that a value for different entries in a table match. For example, with the following simple table:</p>
  
  <pre><code>User     Question   Answer
  -----------------------------------
  Tony      1         Yes
  Bill      1         No
  Jeff      2         Cat
  Tony      2         Dog
  Bill      2         Dog
  Tony      3         No
  </code></pre>
  
  <p>I would like to write a query that tells me that Tony and Bill agree 50% of the time on the two questions that they have both answered.</p>