Where

Table of Contents

Overview
The where clause allows you to add qualifiers to various types of queries.

Inconsitent Schema Fields

Fields are not guaranteed to be consistent across all documents in the schema, if a field is specified in the WHERE clause but not found on a document in the schema, that document will be omitted. Note that this still requires scanning the document for the field - so large queries should avoid inconsistent fields for selection criteria.

Examples
round-pushpin Selects all documents where the text is equal to 'Cat'.
SELECT * FROM WordList:Word WHERE Text = 'Cat'

round-pushpin Selects all documents where the Id is between a given range.
SELECT * FROM WordList:Word WHERE Id BETWEEN 600000 AND 600010

round-pushpin Selects all documents where the text starts with 'cat'
SELECT * FROM WordList:Word WHERE Text LIKE 'Cat%'

round-pushpin Selects all documents where the text ends with 'cat'.
SELECT * FROM WordList:Word WHERE Text LIKE '%Cat'

round-pushpin Selects all documents where the conditions are satisfied.
SELECT
    *
FROM
    WordList:Word
WHERE
    Text LIKE 'Cat%'
    AND (LanguageId = 3 OR LanguageId = 5)


Related