Re: Null in subquery returns no records

From: Paul G. Brown <paul_geoffrey_brown_at_yahoo.com>
Date: 10 Feb 2004 10:37:07 -0800
Message-ID: <57da7b56.0402101037.3a8da9b_at_posting.google.com>


"ben brugman" <ben_at_niethier.nl> wrote in message news:<4028a647$0$1409$4d4ebb8e_at_read.news.nl.uu.net>...
> "Mikito Harakiri" <mikharakiri_at_iahu.com> wrote in message
> news:7qXVb.46$St1.210_at_news.oracle.com...
> > "Paul G. Brown" <paul_geoffrey_brown_at_yahoo.com> wrote in message
> > news:57da7b56.0402091702.5a3fe316_at_posting.google.com...
> > [B]: Codd himself first broached the subject of missing information and
> > unknown or null values. Now, once you have missing values you've
> > got to figure out what to do about them. Eventually it was decided
> > that anytime you did anything with a variable whose value was marked
> > as "unknown", the result would also be "unknown".
>
> I do disagree with that :
>
> Null or true evaluates to True
> and
> Null and false evaluates to False
>
> > That was the design. The implementation turned out to be
> >
> > "Anytime you did anything with a variable whose value was marked
> > as 'unknown', the result would be surprising for the end user".

  Ben and Mikito are both correct. The SQL truth table version of the   "right", "left" and "up" logic look like this:

       AND->V1  "left"  "right"  "up"   OR->V1   "left"  "right"   "up"
        "left"  "left"  "right"  "up"     "left" "left"   "left"  "left"
        
       "right" "right"  "right" "right"  "right" "left"  "right"   "up"
  
          "up"   "up"   "right"  "up"     "up"   "left"     "up"   "up"

    (And that should have been "OR", not "XOR": typo).

   I was trying to emphasise the point that your selection of logical   rules is arbitrary. SQL picked one. There were others. And it's not   clear to me that any one of them is better than any other. Received on Tue Feb 10 2004 - 19:37:07 CET

Original text of this message