Re: Comparing bit in an integer field

From: Amitabh Kant <amitabhkant(at)gmail(dot)com>
To: "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>
Cc: pgsql-general(at)postgresql(dot)org, Thom Brown <thombrown(at)gmail(dot)com>
Subject: Re: Comparing bit in an integer field
Date: 2009-11-16 15:45:24
Message-ID: 84b68b3d0911160745q72c9cb34k8456a8f1011839a8@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Nov 16, 2009 at 7:53 PM, A. Kretschmer <
andreas(dot)kretschmer(at)schollglas(dot)com> wrote:

> In response to Amitabh Kant :
>
> test=# select * from t1;
> a1
> ----
> 0
> 12
> 8
> 0
> 1
> 10
> 7
> 19
> (8 rows)
>
> test=*# select a1 from t1 where (a1>>2)::bit = B'1';
> a1
> ----
> 12
> 7
> (2 rows)
>
>
> Regards, Andreas
>

Thanks. That should solve my problem.

Amitabh

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Peter Hunsberger 2009-11-16 15:57:24 Re: Experience with many schemas vs many databases
Previous Message Scott Marlowe 2009-11-16 15:39:57 Re: safelly erasing dirs/files