The following SQL snippet applies bitwise OR on all the values in numbers table's value column. This example supports up to 8 bits; you can easily extend it to support more.
CREATE TEMP TABLE numbers(value INTEGER);
INSERT INTO numbers VALUES(2);
INSERT INTO numbers VALUES(3);
INSERT INTO numbers VALUES(15);
select
((sum(value&1)>0) << 0) +
((sum(value&2)>0) << 1) +
((sum(value&4)>0) << 2) +
((sum(value&8)>0) << 3) +
((sum(value&16)>0) << 4) +
((sum(value&32)>0) << 5) +
((sum(value&64)>0) << 6) +
((sum(value&128)>0) << 7)
from numbers;
CREATE TEMP TABLE numbers(value INTEGER);
INSERT INTO numbers VALUES(2);
INSERT INTO numbers VALUES(3);
INSERT INTO numbers VALUES(15);
select
((sum(value&1)>0) << 0) +
((sum(value&2)>0) << 1) +
((sum(value&4)>0) << 2) +
((sum(value&8)>0) << 3) +
((sum(value&16)>0) << 4) +
((sum(value&32)>0) << 5) +
((sum(value&64)>0) << 6) +
((sum(value&128)>0) << 7)
from numbers;