title: Group by, then select only records where every value of a boolean column is true
body: <p>I have both a MS SQL Database and a postgres database.  A solution in either will work as I can translate it.</p>
  
  <p>We have a <code>customer_phone</code> table where the relevant columns are:</p>
  
  <pre><code>id, customer_id, phone, is_bad
  </code></pre>
  
  <p>What I need to do is select all the <code>customer_id</code>'s from this table that ONLY have <code>is_bad = true</code>. So if you have 1 good phone number and 1 bad, you shouldn't appear.  </p>
  
  <p>For some reason I'm struggling to find an easy way to do this, I feel like it should be deceptively simple.</p>
  
  <p>This was a start that gives me at least all the customers a count of their good and bad numbers, but I'm wondering if there is a way that doesn't involve having to use subqueries and <code>in</code>'s? </p>
  
  <pre><code>select  customer_id, is_bad, count(customer_id)
  from customer_phone cp
  group by customer_id, is_bad
  order by customer_id desc
  </code></pre>