Possible Duplicates:
Aggregate bitwise-OR in a subquery
Update column to be different aggregate values
Let's say I have a table with the following records.
Role | AuthorizationNum
1 11
2 12
1 16
2 11
What I want to do is group by Role, the OR (BIT OR using |) AuthorizationNum. So my select should be 2 records.
Role | AuthorizationNum
1 27
2 15
Because...
11 | 16 = 27
11 | 12 = 15