multiple use of DISTINCT keyword
Posted in 1995
Can anyone explain why Informix doesn't allow multiple occurrences of the DISTINCT keyword within a single select-statement (at the same level of nesting)? The SQL2 standard doesn't seem to impose any restrictions on this (cf. my posting in comp.databases.theory). Oracle e.g. doesn't seem to have any problems with this kind of queries. E.g. SELECT cust-num, COUNT (DISTINCT order-num), COUNT (DISTINCT order-date) FROM order GROUP BY cust-num or SELECT cust-num, COUNT (DISTINCT order-num) FROM order GROUP BY cust-num HAVING COUNT (DISTINCT order-num) > 2; are not allowed in Informix. Notice that in the second example, the 2 expressions using DISTINCT are the same, so that shouldn't be a problem for the optimizer ... Regards, Ria. ----------------------------------------------------------- Ria Vandenberghe Ria.Vandenberghe@rug.ac.be UNIVERSITY OF GHENT (BELGIUM) - Computer Science Laboratory Technologiepark-Zwijnaarde 9, B-9052 ZWIJNAARDE, BELGIUM tel: +32/9/264.55.10 fax: +32/9/264.58.42