Using & - operator

From: Rado Petrik <r(dot)p(at)szm(dot)sk>
To: pgsql-sql(at)postgresql(dot)org
Subject: Using & - operator
Date: 2003-06-02 13:34:15
Message-ID: 1054560854.622.14.camel@caj
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(dot)p(at)szm(dot)sk>

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2003-06-02 13:42:37 Re: SQL problem: bank account
Previous Message Jonathan Gardner 2003-06-02 13:20:56 Re: SQL problem: bank account