pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: CoL <col@mportal.hu>
To: pgsql-sql@postgresql.org
Subject: Re: problem porting MySQL SQL to Postgres
Date: Thu, 15 Apr 2004 13:30:12 +0200
Message-ID: <c5lro4$2mip$1@news.hub.org> (raw)
In-Reply-To: <4A063822-8EC7-11D8-9677-000A958E367A@llgc.org.uk>
References: <4A063822-8EC7-11D8-9677-000A958E367A@llgc.org.uk>

hi,

Dan Field wrote:

> I've stumbled across a query I don't quite understand the error message 
> for.
> 
> This query is pulled from a working MySQL setup:
> 
> SELECT
>     DEWEY_ID, DEWEY_HUNDREDS, DEWEY_TENS, DEWEY_ONES,     
> DEWEY_POINT_ONES, DEWEY_POINT_TENS,    
>     DEWEY_POINT_HUNDREDS, DEWEY_POINT_THOUSANDS,      DEWEY_TYPE, 
> DEWEY_LANG,  DEWEY_SUBJECT  FROM lu_dewey
> WHERE
>     (DEWEY_HUNDREDS = 9) AND
>     (DEWEY_TENS >= 0) AND    
>     (DEWEY_TENS <= 9) AND
>     (DEWEY_ONES = 0 || DEWEY_ONES = NULL) AND
>     (DEWEY_POINT_ONES = 0 || DEWEY_POINT_ONES = NULL) AND
>     (DEWEY_POINT_TENS = 0 || DEWEY_POINT_TENS = NULL) AND
>     (DEWEY_POINT_HUNDREDS = 0 || DEWEY_POINT_HUNDREDS = NULL) AND
>     (DEWEY_POINT_THOUSANDS = 0 || DEWEY_POINT_THOUSANDS = NULL) AND
>     (DEWEY_TYPE = 't') AND
>     (DEWEY_LANG = 'en')
> ORDER BY DEWEY_TENS
> 
> 
> However I'm getting the following error:
> 
>  ERROR:  Unable to identify an operator '=' for types 'character' and 
> 'boolean' You will have to retype this query using an explicit cast.

use OR not ||.

C.



view thread (8+ messages)  latest in thread

Message-ID: <c5lro4$2mip$1@news.hub.org>
Permalink:  ../c5lro4$2mip$1@news.hub.org/
Also on:    postgresql.org/message-id/c5lro4$2mip$1@news.hub.org

 · 

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: col@mportal.hu
  Subject: Re: problem porting MySQL SQL to Postgres
  In-Reply-To: <c5lro4$2mip$1@news.hub.org>

* 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