title: Removing rows based on other rows and merging the remaining rows
body: <p>I am having some trouble trying to get a table to show only the information that I want. I am trying to get the below table to only show ID's which have no true statements (1's) for either column 1 or column 2</p>
  
  <pre><code>IDs     | Column2 | Column3
  --------+---------+--------
  101     |    0    |    0 
  101     |    0    |    1 
  102     |    0    |    0
  102     |    0    |    0
  102     |    0    |    1
  103     |    0    |    0
  103     |    0    |    0
  103     |    0    |    0
  104     |    0    |    0
  104     |    1    |    0
  </code></pre>
  
  <p>Ideally, the above table would be reduced to this:</p>
  
  <pre><code>Column1 | Column2 | Column3
  --------+---------+--------
  103     |    0    |    0 
  </code></pre>
  
  <p>As ID 103 never shows a 1 for either column. Unfortunately I cant wrap my head around the logic. So far I have</p>
  
  <pre><code>SELECT DISTINCT
      IDs,
      Column1,
      Column2
  FROM Table1
  WHERE (Column1 &lt;&gt; 1 AND Column2 &lt;&gt; 1)
  </code></pre>
  
  <p>but this also shows all the rows from the other IDs that do not have a 1 e.g.</p>
  
  <pre><code>IDs     | Column2 | Column3
  --------+---------+--------
  101     |    0    |    0 
  102     |    0    |    0
  102     |    0    |    0
  103     |    0    |    0
  103     |    0    |    0
  103     |    0    |    0
  104     |    0    |    0
  </code></pre>
  
  <p>Is there a way of removing the rows when the ID has another row with a 1 in it, and then merging the remaining rows into single rows based on their ID?</p>
  
  <p>Thanks
  Rob</p>