title: SQL - Selecting all or none in a set of rows
body: <p>I have a table where multiple entries are grouped by having the same number. Each of these rows also have a result. </p>
  
  <p>Example</p>
  
  <pre><code>id 4 | Group 5 | Result 1
  id 5 | Group 5 | Result 1
  id 6 | Group 6 | Result 0
  id 7 | Group 6 | Result 1
  </code></pre>
  
  <p>How would I go about selecting the highest number group where all their result is the same number? </p>
  
  <p>In otherwords, say I want to get the highest group where <code>result = 1</code>; I would not want group 6 as there is a result is 0, nor would I want any groups older than group 4 as all of group 5 have a result of 1.</p>