15.00 - 3627 Illegal use of DISTINCT Aggregate Expressions. - Teradata Database

Teradata Database Messages

Product
Teradata Database
Release Number
15.00
Content Type
Programming Reference
Publication ID
B035-1096-015K
Language
English (United States)

3627 Illegal use of DISTINCT Aggregate Expressions.

Explanation:

The given SELECT operation uses an aggregate function that specifies the DISTINCT option, as in: COUNT( DISTINCT <expression> ); Uses of the DISTINCT modifier are restricted to: (a) the SELECT List, ORDER BY, and HAVING clause of a select statement that uses a GROUP BY clause, or; (b) the first WITH clause SELECT list for select statements that do not use a GROUP BY clause. Multiple use of DISTINCT modifier is restricted when there is a WITH clause. The option can not be used in both places, and the option can not be used in multiple WITH Clauses. In the given query, the DISTINCT option is not being properly used.

Generated By:

OPT modules.

For Whom:

End User.

Remedy:

Correct the request and resubmit it.