title: SQL Server : how can I get difference between counts of total rows and those with only data
body: <p>I have a table with data as shown below (the table is built every day with current date, but I left off that field for ease of reading).</p>
  
  <p>This table keeps track of people and the doors they enter on a daily basis.</p>
  
  <p>Table <strong>entrance_t</strong>:</p>
  
  <pre><code>id   entrance   entered
  ------------------------
  1    a          0
  1    b          0
  1    c          0
  1    d          0
  
  2    a          1
  2    b          0
  2    c          0
  2    d          0
  
  3    a          0
  3    b          1
  3    c          1
  3    d          1
  </code></pre>
  
  <p>My goal is to report on people and count entrances not used(grouping on people), but ONLY if they entered(entered=1).  </p>
  
  <p>So using the above table, I would like the results of query to be...</p>
  
  <pre><code>id   count
  ----------
  2    3
  3    1
  </code></pre>
  
  <p>(id=2 did not use 3 of the entrances and id=3 did not use 1)</p>
  
  <p>I tried queries(some with inner joins on two instances of same table) and I can get the entrances not used, but it's always for everybody. Like this...</p>
  
  <pre><code>id   count
  ----------
  1    4
  2    3
  3    1
  </code></pre>
  
  <p>How do I not display results id=1 since they did not enter at all?</p>
  
  <p>Thank you,</p>