Re: Strange result with select/not null/OR - Mailing list pgsql-general

From Jean-Christian Imbeault
Subject Re: Strange result with select/not null/OR
Date
Msg-id 3EE53871.1010405@mega-bucks.co.jp
Whole thread Raw
In response to Strange result with select/not null/OR  ("Fernando Papa" <fpapa@claxson.com>)
List 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


pgsql-general by date:

Previous
From: "Fernando Papa"
Date:
Subject: Strange result with select/not null/OR
Next
From: Dennis Björklund
Date:
Subject: SQL_ASCII