DISTINCT Keyword
Use the DISTINCT keyword to indicate that duplicate strings should not be included in the result.
Example:
// It is necessary to find out to what contractors
// the goods were shipped for the given period.SELECT
Document.Invoice.Contractor
Query result:
Contractor
Pavilion 45 in wholesale market
Pavilion 45 in wholesale market
"Budenovski" trade house
"Budenovski" trade house
"Budenovski" trade house
"Budenovski" trade house
Clothing fair
"Budenovski" trade house
Pavilion 45 in wholesale market
"Zarya" knitwear factory
"Budenovski" trade house
"Budenovski" trade house
Bavaria China
As you can see, there are many repeated lines in the query result, reducing its clarity. To avoid repetition, you can use the DISTINCT keyword in the query description.
Note. A query that contains the DISTINCT keyword and an ORDER BY clause with an expression, which is not included in the selection list, is treated as invalid. An error message will be displayed. The error message will not be displayed if version 8.1 compatibility mode is enabled.
Example:
Select Distinct
Document.Invoice.Contractor
Query result:
Contractor
"Zarya" knitwear factory
Clothing fair
"Budenovski" trade house
Pavilion 45 in wholesale market
Bavaria China
See also:
Quantity Function
SELECT Clause