Re: Unique Keys

From: Mikito Harakiri <mikharakiri_nospaum_at_yahoo.com>
Date: 25 Nov 2004 18:27:10 -0800
Message-ID: <8a529bb.0411251827.26e7dd5a_at_posting.google.com>


"strider5" <strider5_at_szm.com> wrote in message news:<1101405872.089624.49260_at_z14g2000cwz.googlegroups.com>...
> CREATE TABLE reservations (
> hotel_room char(4),
> span DATEINTERVAL )
>
> select 0 from reservations r1 NATURAL JOIN reservations r2
> where OVERLAPS( r2.SPAN , r1.SPAN) = {}

NATURAL JOIN syntax is so goofy! Isn't your view equivalent to

select 0 from reservations r1, reservations r2 where r1.hotel_room = r2.hotel_room

AND r1.SPAN = r2.SPAN
^^^^^^^^^^^^^^^^^^^^^

and OVERLAPS( r2.SPAN , r1.SPAN)

which always evaluates to empty set? Received on Fri Nov 26 2004 - 03:27:10 CET

Original text of this message