Using & - operator - Mailing list pgsql-sql

From Rado Petrik
Subject Using & - operator
Date
Msg-id 1054560854.622.14.camel@caj
Whole thread Raw
Responses Re: Using & - operator
List pgsql-sql
Hi, 

I have table users;

id  name  bin
--------------1   xx   9    

dec(1) & dec(9) = dec(1)  
bin(0001) & bin(1001) = bin(0001) 

This query is bad. 

SELECT name FROM users WHERE id_user=1 AND (bin & 1) 

This query return 
"Warning: PostgreSQL query failed: ERROR: right- hand side of AND is
type 'integer', not 'boolean' in"


Wow I write corect this query ? 

Thanks. 

-- 
Rado Petrik <r.p@szm.sk>




pgsql-sql by date:

Previous
From: Richard Huxton
Date:
Subject: Re: CASE returning multiple values (was SQL Help)
Next
From: Tom Lane
Date:
Subject: Re: SQL problem: bank account