home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!gatech!emory!hermes1.sps.mot.com
- From: baskett@hermes1.sps.mot.com (Bob Baskett)
- Newsgroups: comp.databases.informix
- Subject: sql question
- Message-ID: <9539@emory.mathcs.emory.edu>
- Date: 15 Sep 92 18:38:06 GMT
- Sender: walt@mathcs.emory.edu
- Reply-To: baskett@hermes1.sps.mot.com (Bob Baskett)
- Lines: 41
- X-Informix-List-ID: <list.1450>
-
-
- help, im having trouble doing a select. we have a table (trace) which
- has two trace_types, (WAF and ASM). what i want to know is the ASM
- source_lots which have more than one WAF source_lot.
-
- the trace table:
-
- create table trace
- (
- source_lot char(16),
- test_lot char(16),
- test_lot_class char(3),
- ...
- );
-
- my first select looks like:
-
- select a.source_lot, count(DISTINCT b.source_lot)
- from system:trace a,
- system:trace b
- where a.trace_type = "ASM"
- and b.trace_type = "WAF"
- and b.test_lot = a.test_lot
- and b.test_lot_class = a.test_lot_class
- group by a.source_lot
- having count(DISTINCT b.source_lot) > 1
-
- which yeilds a syntax error on the 'having count(DISTINCT...'.
-
- i have tried changing the having to 'having 2 > 1' in an attempt to
- force sql to use ordinal types - it failed as well.
-
- i can load my initial select into a temp table and then select from
- it where the count is > 1, but the trace table has 3.8 million rows.
-
- any help/comments would be appreciated.
-
- ------------------------------------------------------------------------------
- Bob Baskett
- Motorola, Inc.
-
-