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 :: Mean
Returns the arithmetic mean of the values in each group (the same as Avg).
SQL :: Median
Returns the median (middle) value in each group. For an even number of values it is the average of the two middle values.
SQL :: Min
Returns the smallest numeric value in each group. Use MinString for text.
SQL :: MinString
Returns the alphabetically smallest value in each group.
SQL :: Mode
Returns the value that occurs most often in each group. When several values are tied, the first one encountered is returned.
SQL :: Offset
Skips a number of rows of an ordered result, for paging.
SQL :: Order By
Order by sorts a result set by a given set of fields or expressions.
SQL :: Select
Select statements are used to read (or query) data from the database.
SQL :: Select Into
Creates a schema and fills it with the results of a SELECT.
SQL :: Sha1Agg
Returns a single SHA-1 hash of all of the values in each group, as a lower case hex string. Useful for detecting changes to a set of documents.