title: SQL Server - group by ID if column contains a value
body: <p>I have following table:</p>
  
  <pre><code>ID   | NR | Status
  1000 | 1  | A
  1000 | 2  | A
  1001 | 3  | A
  1002 | 4  | A
  1002 | 5  | N
  1003 | 6  | N
  </code></pre>
  
  <p>I need to an output which groups these by <code>ID's</code>. The <code>NR</code> column can be ignored. If one of the records with those <code>ID's</code> contains Status A, That <code>status</code> will be given as result.</p>
  
  <p>So my output would be:</p>
  
  <pre><code>ID   | Status
  1000 | A 
  1001 | A 
  1002 | A 
  1003 | N 
  </code></pre>
  
  <p>Any suggestions/ideas?</p>