Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Weird Query

Re: Weird Query

From: Marian Aldenhövel <marian_at_mba-software.de>
Date: Mon, 01 Aug 2005 13:07:36 +0200
Message-ID: <dckvpq$6lo$1@online.de>


Hi,

 > What exactly do you think is wrong in the results?

The query

   SELECT PP_LOCK FROM cbr_385120060b39d42d8 WHERE PP_LOCK <> '';

Does not return any rows although there definitely is exactly one row that satisfied the condition. This is proven by the result of the query without any constraints.

> You know, the '' is equivalent to NULL.

No, I did not know that. I am used to a ternary logic in SQL servers where NULL does not compare to any "real" values.

But this is not the point here as I am trying to query those records that _do_ have text in that field.

> The first query delivers the 1 existing row with a *NOT NULL* value for
> pp_lock ('STEFANWIMMER\goit consulting\658.1_at_STEFANWIMMER'), all
> following have WHERE CLAUSE evaluated to FALSE and as result no rows
> were returned.

Right. But should not exactly one of

   WHERE PP_LOCK<>''
   WHERE PP_LOCK=''
   WHERE PP_LOCK IS NULL

be TRUE for _any_ value of PP_LOCK? My transscript shows that the sample record is not returned for either constraint. The fourth "IS NOT NULL" does in fact return the record but that is not too surprising :-).

Ciao, MM

-- 
Marian Aldenhövel, Rosenhain 23, 53123 Bonn. +49 228 624013.
http://www.marian-aldenhoevel.de
"It's easy to make a small fortune in aviation,
  provided you start with a big one"
Received on Mon Aug 01 2005 - 06:07:36 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US