Function bit_and_append_only

Source
fn bit_and_append_only<T>(state: T, input: T) -> T
where T: BitAnd<Output = T>,
Expand description

Computes the bitwise AND of all non-null input values.

ยงExample

statement ok
create table t (a int2, b int4, c int8);

query III
select bit_and(a), bit_and(b), bit_and(c) from t;
----
NULL NULL NULL

statement ok
insert into t values
   (6, 6, 6),
   (3, 3, 3),
   (null, null, null);

query III
select bit_and(a), bit_and(b), bit_and(c) from t;
----
2 2 2

statement ok
drop table t;