Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> comp.databases.oracle -> Re: Is this a bug or a limitation of the SQL language

Re: Is this a bug or a limitation of the SQL language

From: Michael Perry <map_at_sequent.com>
Date: 26 Aug 92 23:06:30 GMT
Message-ID: <1992Aug26.230630.105@sequent.com>

In article <1992Aug26.090643.1318_at_decuk.uvo.dec.com> sobczak_at_tplab.enet.dec.com (Piotr Sobczak) writes:
>
>In article <1992Aug23.074048.16681_at_prism.poly.edu>, sjha_at_prism.poly.edu (Salil Kumar Jha) writes:
>|> Xref: uvo.dec.com comp.databases:19031 comp.databases.theory:378 comp.databases.oracle:1346
>|> Newsgroups: comp.databases,comp.databases.theory,comp.databases.oracle
>|> Path: uvo.dec.com!rdg.dec.com!news.crl.dec.com!deccrl!caen!destroyer!gatech!news.ans.net!cmcl2!prism.poly.edu!sjha
>|> From: sjha_at_prism.poly.edu (Salil Kumar Jha)
>|> Subject: Is this a bug or a limitation of the SQL language
>|> Message-ID: <1992Aug23.074048.16681_at_prism.poly.edu>
>|> Organization: Polytechnic University, New York
>|> Date: Sun, 23 Aug 92 07:40:48 GMT
>|>
>|> I tried to do this query in Oracle and DB2 and both failed. I know its
>|> not allowed but why not?
>|>
>|> Assume the use of the classic oracle emp table
>|>
>|> select * from emp
>|> where salary between
>|> (select salary from emp where ename = 'Larry')
>|> and
>|> (select salary from emp where ename = 'John')
>|>
>|> Isnt this the best way of finding all people whose salaries lie between those
>|> of Larry and John (without knowing whose is larger)
>|>
>|> sjha_at_prism.poly.edu
>|>
>|>
>
>FWIW, I just tried the syntax above on Rdb/VMS and it worked.
>
>
>Piotr

Did you have multiple rows with Larry and John in it? The problem is that if you have two rows with Larry and one is $50,000 and the other is $60,000 which one gets plugged into the query?

Mike Received on Wed Aug 26 1992 - 18:06:30 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US