Given the following table:
CREATE TABLE BitValues ( n int )
Is it possible to compute the bitwise-OR of n for all rows with
n
I tried using COALESCE function and it works, example:
DECLARE @nOrTotal INT SELECT @nOrTotal = COALESCE(@nOrTotal, 0) | nValor FROM (SELECT 1 nValor UNION SELECT 2 UNION SELECT 2) t SELECT @nOrTotal >> Result: 3