Re: cast bit to boolean? - Mailing list pgsql-general

From Tom Lane
Subject Re: cast bit to boolean?
Date
Msg-id 14557.988931353@sss.pgh.pa.us
Whole thread Raw
In response to Re: cast bit to boolean?  (Robert Hentosh <hentosh@io.com>)
List pgsql-general
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

pgsql-general by date:

Previous
From: Vince Vielhaber
Date:
Subject: Re: Invoices
Next
From: Lamar Owen
Date:
Subject: Re: Ideal hardware configuration for pgsql/Netra