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?
1 Answer