Re: Strange result with select/not null/OR

From: Jean-Christian Imbeault <jc(at)mega-bucks(dot)co(dot)jp>
To: Fernando Papa <fpapa(at)claxson(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Strange result with select/not null/OR
Date: 2003-06-10 01:46:25
Message-ID: 3EE53871.1010405@mega-bucks.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Fernando Papa wrote:
>
> and (sp_link IS NOT NULL OR sp_link <> '')

If sp_link <> '' then it is of course NOT NULL so ...

you get:

sp_link IS NOT NULL --> true
sp_link <> '' --> false

true OR false === true ;)

If I understand what you expect correctly, what you need is:

AND sp_link IS NOT NULL
AND sp_link <> ''

HTH,

--

Jean-Christian Imbeault

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Martijn van Oosterhout 2003-06-10 01:56:24 Re: parse errors when connecting to remote host
Previous Message Robert Fitzpatrick 2003-06-10 01:43:47 Pg_dump for 7.0.2