Re: NULLs: theoretical problems?

From: Jan Hidders <hidders_at_gmail.com>
Date: Thu, 23 Aug 2007 22:02:43 -0000
Message-ID: <1187906563.506451.71800_at_q3g2000prf.googlegroups.com>


On 23 aug, 23:27, "V.J. Kumar" <vjkm..._at_gmail.com> wrote:
> Jan Hidders <hidd..._at_gmail.com> wrote innews:1187902811.569206.68690_at_r23g2000prd.googlegroups.com:
>
>
>
> > On 23 aug, 00:13, "V.J. Kumar" <vjkm..._at_gmail.com> wrote:
> >> Jan Hidders <hidd..._at_gmail.com> wrote
> >> innews:1187811230.504947.11400_at_x40g2000prg.googlegroups.com:
>
> >> > On 22 aug, 17:37, "V.J. Kumar" <vjkm..._at_gmail.com> wrote:
> >> >> In your language, the expression 'def y:x AND y' where 'y' is
> >> >> 'undefined' evaluates to 'false'. In SQL, the expression 'x AND
> >> >> y' where 'y'is 'unknown' evaluates to 'unknown'. The effect of
> >> >> having a predicate that evaluates to 'unknown' is the same as
> >> >> having a predicate that evaluates to 'false': no rows will be
> >> >> selected. That's what I meant by "substituting 'false' for
> >> >> unknown".
>
> >> > That's not exactly the same because there are formulas f(x) that
> >> > evaluate to 'true' if x is 'unknown'.
>
> >> I am not sure I understand what you mean by "That's not exactly the
> >> same...", but I'll take a stab at it.
>
> > I mean that if you take a select-from-where query with a formula f in
> > in the where clause containing the DEF construct then replacing f with
> > f' where all the DEF constructs are removed (i.e. we replace "DEF x :
> > g" with "g" until there are no more such expressions) sometimes
> > changes the meaning of the query.
>
> Let's take a look at it. Could you give a query example and you
> interpretration of the DEF construct therein ?

SELECT * FROM t WHERE DEF t.a : (t.a = 5 OR TRUE);

is not equivalent with

SELECT * FROM t WHERE t.a = 5 OR TRUE;

I'm not sure why you want me to explain the meaning of the DEF construct again, because you already seemed to understand it, but for completeness: the formula "DEF c : f" holds iff the value of column c is defined and the formula f holds.

  • Jan Hidders
Received on Fri Aug 24 2007 - 00:02:43 CEST

Original text of this message