Select

Table of Contents

Overview
Select statements are used to read (or query) data from the database.

Notes on SELECT *

Select * can be used to obtain all fields from the selected documents. Notes that since the fields are not guaranteed to be consistent across all documents in the schema, that select * can be quite inefficient as the cononical model is materialized since extra locking is required.

Inconsitent Schema Fields

Fields are not guaranteed to be consistent across all documents in the schema, any fields that are referenced will be selected but will be NULL for documents where the field does not exist.

Examples
round-pushpin Statement to select all fields from the Word schema.
SELECT
    *
FROM
    WordList:Word

round-pushpin Statement to select specific fields from Word schema.
SELECT
    Id, Text, LanguageId
FROM
    WordList:Word

round-pushpin Statement to select specific fields from Word schema for a given Text value.
SELECT
    Id, Text, LanguageId
FROM
    WordList:Word
WHERE
    Text = 'Summary'


Related