Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!purdue!ames!apple!agate!ucbvax!mtxinu!sybase!jeffl@sybase.Sybase.COM From: jeffl@sybase.Sybase.COM (Jeff Lichtman) Newsgroups: comp.databases Subject: Re: Sybase bug? Message-ID: <5003@sybase.sybase.com> Date: 11 Jul 89 04:18:15 GMT References: <2099@cucstud.UUCP> Sender: news@sybase.sybase.com Lines: 26 I hate being wrong.... My previous analysis of the problem was incorrect. The query: select * from hello where a = 1 or a in (select b from world) should return rows even if the table "world" contains no rows. The rule about forming the Cartesian product first applies to tables in the same "from" clause. The SQL 86 standard says that each row from the Cartesian product is applied to the where clause one at a time. If there is a subquery, it is evaluated once per Cartesian product row from the outer query. > "2. R WHERE c1 OR c2 > is defined to be equivalent to > ( R WHERE c1 ) UNION ( R WHERE c2 )" I can't find this in my edition of Date, but I have an old 3rd edition. I don't think it is correct. At least, it doesn't match the ANSI standard. What edition of Date do you have, and what section are you quoting? --- Jeff Lichtman at Sybase {mtxinu,pacbell}!sybase!jeffl -or- jeffl@sybase.com "Saints should always be judged guilty until they are proved innocent..."