pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rado Petrik <r.p@szm.sk>
To: pgsql-sql@postgresql.org
Subject: Using & - operator
Date: 02 Jun 2003 15:34:15 +0200
Message-ID: <1054560854.622.14.camel@caj> (raw)

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>





view thread (2+ messages)  latest in thread

Message-ID: <1054560854.622.14.camel@caj>
Permalink:  ../1054560854.622.14.camel@caj/
Also on:    postgresql.org/message-id/1054560854.622.14.camel@caj

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: r.p@szm.sk
  Subject: Re: Using & - operator
  In-Reply-To: <1054560854.622.14.camel@caj>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox