Given the following table:
CREATE TABLE BitValues ( n int )
Is it possible to compute the bitwise-OR of n
for all rows within a subquery? For example, if BitValues contains these 4 rows:
+---+
| n |
+---+
| 1 |
| 2 |
| 4 |
| 3 |
+---+
I would expect the subquery to return 7. Is there a way to do this inline, without creating a UDF?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…