开发者_开发问答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
By default mysql supports this but not sql server. But you can get around it using this: Update column to be different aggregate values
精彩评论