Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!mailrus!tut.cis.ohio-state.edu!cs.utexas.edu!uunet!cuc1!lcain From: lcain@cuc1.UUCP (Leroy Cain) Newsgroups: comp.databases Subject: Re: Sybase bug? Summary: Other RDBMS work Message-ID: <2098@cuc1.UUCP> Date: 5 Jul 89 05:10:52 GMT References: <613@kylie.oz> <571@daitc.daitc.mil> Organization: Columbia Union College; Takoma Park, MD 20912 Lines: 44 In article <571@daitc.daitc.mil>, jkrueger@daitc.daitc.mil (Jonathan Krueger) writes: > In article <613@kylie.oz>, christie@kylie (Chris Tham) writes: > >I found the following anomaly and wondered if it is a bug in Sybase or > >normal in SQL: [test case looks like: > > +-------+ +-------+ > | hello | a | world | b > +-------+------+ +-------+------+ > | 1 | +------+ > +------+ > > select * from hello where a = 1 or a in (select b from world); > > +--------+ > | result | a > +--------+------+ > +------+ > > It's normal. The semantics are usually unintended, however. The > subquery implies a join to an empty table. This means a cartesian > product where one matrix has size zero. Or if you prefer, in the > relational model intersection is undefined on two relations if either > is empty. That is an interesting explanation but I don't buy it. I checked Informix-SQL and Unify 3.2 and they both product the correct results. +--------+ | result | a +--------+------+ | 1 | +------+ [ example of union delete ] So why the example using a union ( which is correct ) if you think there is an intersection? Or am I just misunderstand you? MS-DOS Just say NO!!!!! OS/2 Why???? Leroy Cain; Columbia Union College; Mathematical Sciences Department 7600 Flower Ave. WH406; Takoma Park, Md 20912 (301) 891-4172 uunet!cucstud!lcain