title: SQL Server Group By Bitwise Or?
body: <blockquote>
    <p><strong>Possible Duplicates:</strong><br>
    <a href="https://stackoverflow.com/questions/3981050/aggregate-bitwise-or-in-a-subquery">Aggregate bitwise-OR in a subquery</a><br>
    <a href="https://stackoverflow.com/questions/1112382/update-column-to-be-different-aggregate-values">Update column to be different aggregate values</a>  </p>
  </blockquote>
  
  
  
  <p>Let's say I have a table with the following records.</p>
  
  <pre><code>Role | AuthorizationNum
  
  1      11
  2      12
  1      16
  2      11
  </code></pre>
  
  <p>What I want to do is group by Role, the OR (BIT OR using |) AuthorizationNum.  So my select should be 2 records.</p>
  
  <pre><code>Role | AuthorizationNum
  
  1      27
  2      15
  </code></pre>
  
  <p>Because...</p>
  
  <p>11 | 16 = 27</p>
  
  <p>11 | 12 = 15</p>