Consultor Eletrônico



Kbase P91993: Inconsistency in the syntax for the DISTINCT keyword.
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   03/09/2004
Status: Unverified

FACT(s) (Environment):

OpenEdge 10.0A

SYMPTOM(s):

Inconsistency in the syntax for the DISTINCT keyword.

When using the DISTINCT keyword as a function it sometimes returns a syntax error.

DISTINCT is treated as a function under certain circumstances.

CAUSE:

This is expected behavior.

FIX:

DISTINCT is a keyword which can be specified immediately after SELECT. What follows the DISTINCT keyword is the standard SELECT expression list.

The following examples illustrate the differences in syntax:
SELECT DISTINCT country FROM pub.customer;
SELECT DISTINCT(country) FROM pub.customer;

"(country)" is simply a standard expression, because any expression can be enclosed in parentheses, and a simple column reference is an expression.