Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!agate!ucbvax!decwrl!nsc!voder!cullsj!gupta From: gupta@cullsj.UUCP (Yogesh Gupta) Newsgroups: comp.databases Subject: Re: Sybase bug? Summary: Definitely a bug according to the ANSI definition of SQL. Message-ID: <637@cullsj.UUCP> Date: 8 Jul 89 00:18:09 GMT References: <613@kylie.oz> Organization: Cullinet Software, San Jose, CA Lines: 29 In article <613@kylie.oz>, christie@kylie.oz (Chris Tham) writes: > I found the following anomaly and wondered if it is a bug in Sybase or > normal in SQL: > [...] > > select * from hello where a = 1 or a in (select b from world) > a > ----------- > > (0 rows affected) > -- According to the ANSI SQL86 standard, a the result of a is "The result derived by the application of the specified boolean operators to the conditions that result from the application of EACH specified to a given row of a table or a given group of a grouped table." (General Rule #1). [Emphasis on EACH is mine]. 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. Also, according to the truth tables described in General Rule #2, the search condition would be true for the row. Thus, the result should contain 1 row. Yogesh Gupta. ---- The above opinions are my own, and not those of Cullinet.