Robert Hentosh <hentosh@io.com> writes:
> If you want only the rows where both bits are set then try:
>
> select * from t1 where ( sel_a & b'100001' = b'100001' );
Or for the other case,
select * from t1 where ( sel_a & b'100001' != b'000000');
regards, tom lane