Path: utzoo!attcan!uunet!ginosko!aplcen!unmvax!tut.cis.ohio-state.edu!ucbvax!mtxinu!sybase!jeffl@sybase.Sybase.COM From: jeffl@sybase.Sybase.COM (Jeff Lichtman) Newsgroups: comp.databases Subject: Re: Sybase bug? Message-ID: <4982@sybase.sybase.com> Date: 9 Jul 89 01:50:46 GMT References: <637@cullsj.UUCP> Sender: news@sybase.sybase.com Lines: 24 >> > select * from hello where a = 1 or a in (select b from world) > > Thus, the predicate a = 1 should be applied to each row of the table > hello, and would be true for the one row that exists in table hello... > Thus, the result should contain 1 row. > > Yogesh Gupta. The result of a SQL query is supposed to be as if the following operations were performed (in this order): 1) Cartesian product 2) Restriction (where clause) 3) Projection (select list) (Note that this doesn't necessarily describe the actual processing strategy.) In this case, the Cartesian product of the tables contains no rows, so the answer contains no rows. A previous posting had it right: 'or' does not mean 'union'. --- Jeff Lichtman at Sybase {mtxinu,pacbell}!sybase!jeffl -or- jeffl@sybase.com "Saints should always be judged guilty until they are proved innocent..."