home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / database / 7994 < prev    next >
Encoding:
Internet Message Format  |  1992-11-20  |  1.7 KB

  1. Xref: sparky comp.databases:7994 comp.databases.ingres:1952
  2. Newsgroups: comp.databases,comp.databases.ingres
  3. Path: sparky!uunet!snorkelwacker.mit.edu!bloom-picayune.mit.edu!thomasl
  4. From: thomasl@mtl.mit.edu (Thomas J Lohman)
  5. Subject: SQL Query and a QUEL query
  6. Message-ID: <1992Nov20.225217.19430@athena.mit.edu>
  7. Sender: news@athena.mit.edu (News system)
  8. Nntp-Posting-Host: garcon.mit.edu
  9. Organization: MIT Microsystems Technology Laboratories
  10. References: <13NOV199213095729@erich.triumf.ca> <1992Nov16.183201.13342@oracle.us.oracle.com> <1992Nov19.191535.17846@cs.rochester.edu>
  11. Date: Fri, 20 Nov 1992 22:52:17 GMT
  12. Lines: 28
  13.  
  14.  
  15. Perhaps it is too late in the week, and/or I'm rusty with SQL, but I'm
  16. having difficulty nonetheless.
  17.  
  18. I want to select all entries of a table like so based on some
  19. qualifications:
  20.  
  21. select ta1.name from table1 ta1, table2 ta2 where ((ta1.id = ta2.id
  22. and ta2.string = "testing" and ta2.sequence = 1) and (ta1.id = ta2.id and
  23. ta2.string = "testing2" and ta2.sequence = 2))
  24.  
  25. I implemented my actual query using the exist stuff like so:
  26.  
  27. select l.nam1 from labus38 l where exists (select a.labus38 from la38_ad10 a where a.LABUS38 = l.eid and a.VARST17 = 'This is a test of the varstring type.  This is only a test.  If this had been an actual advice string, then it would contain inf' and a.seq = 1) AND exists (select a.labus38 from la38_ad10 a where a.LABUS38 = l.eid and a.VARST17 = 'ormation pertinent to this labuser, but alas it does not.' and a.seq = 2)
  28.  
  29. Please ignore the long stupid strings...
  30.  
  31. Now, what I want to know is how do I do this in QUEL?  And is there an 
  32. easier way to do it in SQL without having to use the exists stuff?
  33.  
  34. Please be patient with my ignorance.
  35.  
  36.  
  37. thanks,
  38.  
  39.  
  40. --tom
  41.  
  42.