home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / database / 6265 < prev    next >
Encoding:
Internet Message Format  |  1992-08-22  |  904 b 

  1. Xref: sparky comp.databases:6265 comp.databases.theory:375 comp.databases.oracle:1338
  2. Newsgroups: comp.databases,comp.databases.theory,comp.databases.oracle
  3. Path: sparky!uunet!gatech!news.ans.net!cmcl2!prism.poly.edu!sjha
  4. From: sjha@prism.poly.edu (Salil Kumar Jha)
  5. Subject: Is this a bug or a limitation of the SQL language
  6. Message-ID: <1992Aug23.074048.16681@prism.poly.edu>
  7. Organization: Polytechnic University, New York
  8. Date: Sun, 23 Aug 92 07:40:48 GMT
  9. Lines: 16
  10.  
  11. I tried to do this query in Oracle and DB2 and both failed. I know its
  12. not allowed but why not?
  13.  
  14. Assume the use of the classic oracle emp table
  15.  
  16. select * from emp 
  17. where salary between
  18. (select salary from emp where ename = 'Larry')
  19. and
  20. (select salary from emp where ename = 'John')
  21.  
  22. Isnt this the best way of finding all people whose salaries lie between those
  23. of Larry and John (without knowing whose is larger)
  24.  
  25. sjha@prism.poly.edu
  26.  
  27.