home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / database / informix / 1939 < prev    next >
Encoding:
Internet Message Format  |  1992-09-15  |  1.4 KB

  1. Path: sparky!uunet!gatech!emory!hermes1.sps.mot.com
  2. From: baskett@hermes1.sps.mot.com (Bob Baskett)
  3. Newsgroups: comp.databases.informix
  4. Subject: sql question
  5. Message-ID: <9539@emory.mathcs.emory.edu>
  6. Date: 15 Sep 92 18:38:06 GMT
  7. Sender: walt@mathcs.emory.edu
  8. Reply-To: baskett@hermes1.sps.mot.com (Bob Baskett)
  9. Lines: 41
  10. X-Informix-List-ID: <list.1450>
  11.  
  12.  
  13. help, im having trouble doing a select.  we have a table (trace) which
  14. has two trace_types, (WAF and ASM).  what i want to know is the ASM
  15. source_lots which have more than one WAF source_lot.
  16.  
  17. the trace table:
  18.  
  19. create table trace
  20.   (
  21.   source_lot     char(16),
  22.   test_lot    char(16),
  23.   test_lot_class char(3),
  24.         ...
  25.   );
  26.  
  27. my first select looks like:
  28.  
  29. select a.source_lot, count(DISTINCT b.source_lot)
  30. from   system:trace a,
  31.        system:trace b
  32. where  a.trace_type = "ASM"
  33.   and  b.trace_type = "WAF"
  34.   and  b.test_lot = a.test_lot
  35.   and  b.test_lot_class = a.test_lot_class
  36. group by a.source_lot
  37. having count(DISTINCT b.source_lot) > 1
  38.  
  39. which yeilds a syntax error on the 'having count(DISTINCT...'.
  40.  
  41. i have tried changing the having to 'having 2 > 1' in an attempt to
  42. force sql to use ordinal types - it failed as well.
  43.  
  44. i can load my initial select into a temp table and then select from
  45. it where the count is > 1, but the trace table has 3.8 million rows.
  46.  
  47. any help/comments would be appreciated.
  48.  
  49. ------------------------------------------------------------------------------
  50. Bob Baskett
  51. Motorola, Inc.
  52.  
  53.