home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / database / 6356 < prev    next >
Encoding:
Internet Message Format  |  1992-08-26  |  2.2 KB

  1. Xref: sparky comp.databases:6356 comp.databases.theory:403 comp.databases.oracle:1393
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!uwm.edu!ogicse!sequent!muncher.sequent.com!map
  3. From: map@sequent.com (Michael Perry)
  4. Newsgroups: comp.databases,comp.databases.theory,comp.databases.oracle
  5. Subject: Re: Is this a bug or a limitation of the SQL language
  6. Message-ID: <1992Aug26.230630.105@sequent.com>
  7. Date: 26 Aug 92 23:06:30 GMT
  8. Article-I.D.: sequent.1992Aug26.230630.105
  9. References: <1992Aug23.074048.16681@prism.poly.edu> <1992Aug26.090643.1318@decuk.uvo.dec.com>
  10. Sender: usenet@sequent.com (usenet )
  11. Organization: Sequent Computer Systems Inc.
  12. Lines: 40
  13. Nntp-Posting-Host: sequent.sequent.com
  14.  
  15. In article <1992Aug26.090643.1318@decuk.uvo.dec.com> sobczak@tplab.enet.dec.com (Piotr Sobczak) writes:
  16. >
  17. >In article <1992Aug23.074048.16681@prism.poly.edu>, sjha@prism.poly.edu (Salil Kumar Jha) writes:
  18. >|> Xref: uvo.dec.com comp.databases:19031 comp.databases.theory:378 comp.databases.oracle:1346
  19. >|> Newsgroups: comp.databases,comp.databases.theory,comp.databases.oracle
  20. >|> Path: uvo.dec.com!rdg.dec.com!news.crl.dec.com!deccrl!caen!destroyer!gatech!news.ans.net!cmcl2!prism.poly.edu!sjha
  21. >|> From: sjha@prism.poly.edu (Salil Kumar Jha)
  22. >|> Subject: Is this a bug or a limitation of the SQL language
  23. >|> Message-ID: <1992Aug23.074048.16681@prism.poly.edu>
  24. >|> Organization: Polytechnic University, New York
  25. >|> Date: Sun, 23 Aug 92 07:40:48 GMT
  26. >|> 
  27. >|> I tried to do this query in Oracle and DB2 and both failed. I know its
  28. >|> not allowed but why not?
  29. >|> 
  30. >|> Assume the use of the classic oracle emp table
  31. >|> 
  32. >|> select * from emp 
  33. >|> where salary between
  34. >|> (select salary from emp where ename = 'Larry')
  35. >|> and
  36. >|> (select salary from emp where ename = 'John')
  37. >|> 
  38. >|> Isnt this the best way of finding all people whose salaries lie between those
  39. >|> of Larry and John (without knowing whose is larger)
  40. >|> 
  41. >|> sjha@prism.poly.edu
  42. >|> 
  43. >|> 
  44. >
  45. >FWIW, I just tried the syntax above on Rdb/VMS and it worked.
  46. >
  47. >
  48. >Piotr
  49.  
  50. Did you have multiple rows with Larry and John in it?  The problem is
  51. that if you have two rows with Larry and one is $50,000 and the
  52. other is $60,000 which one gets plugged into the query?
  53.  
  54. Mike
  55.