Distinct



SELECT DISTINCT removes duplicate rows from the results. Two rows are duplicates when every selected value is the same.

round-pushpin Returns each language id that is used by a word.
SELECT DISTINCT LanguageId FROM WordList:Word

round-pushpin Returns the distinct first letters of the words.
SELECT DISTINCT ToUpper(Left(Text, 1)) as Initial FROM WordList:Word

DISTINCT can be written before or after Top: SELECT DISTINCT TOP 10 removes duplicates before the limit is applied, and SELECT TOP 10 DISTINCT limits the rows before removing duplicates.



SQL :: Aggregate Functions
Aggregate functions compute one value from a group of rows.
SQL :: Avg
Returns the average (arithmetic mean) of the values in each group.
SQL :: Count
Returns the number of values in each group. Count(0) and Count(*) count the documents in each group.
SQL :: CountDistinct
Returns the number of distinct values in each group. Values are compared without regard to case unless caseSensitive is true.
SQL :: Expressions
Literals, operators, comments and variables in KBSQL.
SQL :: GeometricMean
Returns the geometric mean of the values in each group: the nth root of their product. Useful for growth rates and ratios.
SQL :: Group By
Group by collapses a result set into one row per distinct set of values.
SQL :: Keywords
A breakdown of all of the statements and keywords supported by the query processor.
SQL :: Max
Returns the largest numeric value in each group. Use MaxString for text.
SQL :: MaxString
Returns the alphabetically largest value in each group.