Select
Table of Contents
SELECT reads documents from one or more schemas.
SELECT [DISTINCT] [TOP n] { * | alias.* | expression [as Name], ... }
[INTO TargetSchema]
FROM Schema [as alias]
[INNER JOIN | OUTER JOIN Schema as alias ON conditions] ...
[WHERE conditions]
[GROUP BY expression, ...]
[ORDER BY expression [ASC | DESC], ...]
[OFFSET n]Notes on SELECT *
SELECT * returns every field found in the selected documents. Since documents in a schema don't need to have the same fields, SELECT * must examine every selected document to build the list of fields.Inconsistent schema fields
Fields are not guaranteed to exist in every document. Fields that are selected but missing from a document are returned as NULL. Set WarnMissingFields to be warned about them.Fields and expressions can be given a name with as. The as keyword is required. Names that contain spaces must be quoted. Expressions without a name are returned as Expression0, Expression1 and so on.
SELECT * FROM WordList:WordSELECT
Id,
Text,
Id * 10 as Score,
ToUpper(Text) as 'Upper Case'
FROM
WordList:Word
WHERE
LanguageId = 1SELECT
w.*
FROM
WordList:Word as w
INNER JOIN WordList:Language as l
ON l.Id = w.LanguageId
WHERE
l.Name = 'German'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 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.
SQL :: Sha256Agg
Returns a single SHA-256 hash of all of the values in each group, as a lower case hex string. Useful for detecting changes to a set of documents.
SQL :: Sha512Agg
Returns a single SHA-512 hash of all of the values in each group, as a lower case hex string. Useful for detecting changes to a set of documents.
SQL :: Single
A built-in schema containing exactly one document, used to evaluate constant expressions.