[GENERAL] Comparing bit in an integer field

2009-11-16 Thread Amitabh Kant
Hello I need to compare the bit values of a integer field in my table. For example, I have a table called t1 with just one field a1 having following values: a1 == 0 12 8 0 1 10 7 19 I am trying to fetch all records where the 3rd binary bit is 1, which from the above example should be 12

Re: [GENERAL] Comparing bit in an integer field

2009-11-16 Thread Thom Brown
2009/11/16 Amitabh Kant amitabhk...@gmail.com: Hello I need to compare the bit values of a integer field in my table. For example, I have a table called t1 with just one field a1 having following values: a1 == 0 12 8 0 1 10 7 19 I am trying to fetch all records where the 3rd

Re: [GENERAL] Comparing bit in an integer field

2009-11-16 Thread A. Kretschmer
In response to Amitabh Kant : Hello I need to compare the bit values of a integer field in my table. For example, I have a table called t1 with just one field a1 having following values: a1 == 0 12 8 0 1 10 7 19 I am trying to fetch all records where the 3rd binary bit is 1,

Re: [GENERAL] Comparing bit in an integer field

2009-11-16 Thread Thom Brown
2009/11/16 A. Kretschmer andreas.kretsch...@schollglas.com: In response to Amitabh Kant : Hello I need to compare the bit values of a integer field in my table. For example, I have a table called t1 with just one field a1 having following values: a1 == 0 12 8 0 1 10 7 19 I am

Re: [GENERAL] Comparing bit in an integer field

2009-11-16 Thread Amitabh Kant
On Mon, Nov 16, 2009 at 7:53 PM, A. Kretschmer andreas.kretsch...@schollglas.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 (a12)::bit = B'1'; a1 12 7 (2 rows) Regards,