title: How to use WHERE statement in SQL to exclude a group
body: <p>I have a complex query, but here is the essence of what I'm trying to do</p>
  
  <p>In a table looking like this:</p>
  
  <pre>
  Col1 Col2  
  Bill 0  
  Bill 0  
  Bill 0  
  Bill 1  
  Bill 1  
  John 1  
  John 1  
  Jonh 1  
  </pre>
  
  <p>The above table has 2 columns. I am trying to query the rows that has '1' in all the rows in column 2. Since 'Bill' rows with '0' and '1', bill must be excluded. Subquery in the WHERE statement gives more than one result, and doen't work.</p>
  
  <pre><code>SELECT t1.Col1
  FROM Table1 t1
  WHERE t1.Col1 &lt;&gt; (SELECT t1.Col1 FROM Table1 t1 WHERE t1.Col2 &lt;&gt; '0')
  </code></pre>
  
  <p>Using a form of loop statement in the query would bring a whole new level of headache to my project so I hope any smart person can assist me in my quest.</p>